U3D for a classical problem: The Dining problem of Philosophers Google drive link:https://drive.google.com/file/d/17UR2UWDcByBuNQBN5ULk2ntM2gSpFfLR/view?usp=sharing
This is my programming assignment in 2020.
The Dining Philosophers problem is a classic problem in computer science that demonstrates the problem of Synchronization of multiple threads in concurrent computing.
The dining philosophers problem can be formulated as five philosophers sitting around a round table doing one of two things: eating, or thinking. When they eat, they stop thinking, and when they think, they stop eating. There are five bowls of pasta on the table, with a fork between each philosopher. Since it is difficult to eat pasta with one fork, it is assumed that the philosopher must eat with two forks. They can only use the two forks on their left and right hand. The philosopher's dining problem is also sometimes described in terms of rice and five chopsticks instead of pasta and a fork, because two chopsticks are necessary to eat rice.
The question is how to devise a set of rules so that philosophers can forever alternate between these two states without talking at all, that is, without knowing when others might be eating or thinking.
In my code, I implemented a variety of solutions to the dining philosophers problem and displayed them in Unity3D.
language in Chinese