Git Product home page Git Product logo

the-dining-problem-of-philosophers's Introduction

The-Dining-problem-of-Philosophers

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

How to use:

  1. Download the package from Google Drive and install, click PhilosopherIsEating.exe for game.
  2. main menu image
  3. choose one mode image
  4. start your game: image
  5. Check the status of each philosopher with fork image

the-dining-problem-of-philosophers's People

Contributors

lijiae avatar

Stargazers

Xuefen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.