Jump to content

Graph grammar

- - - - -

  • Please log in to reply
No replies to this topic

#1
Apprentice123

Apprentice123

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 430 posts
How, using graph grammar, it is possible to model the dining philosophers problem?
Exist N philosophers and N forks.
Philosophers can:
1. thinking (no fork in the hands)
2. eating (one fork in the right hand and other in the left hand)
3. trying eat (only one fork in the hands)


I do not know how I can shape grammar graph of the following considerations:
--> No forks in their hands if it is thinking
--> Two forks in their hands if it is eating
--> One fork in their hand and waiting one fork in the other hand





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users