Petri — dining philosophers (2)
Two-philosopher version of the dining-philosophers problem.
Make it your own.
title "Dining philosophers (2)"
place think1 tokens 1 "Phil 1 thinking"
place think2 tokens 1 "Phil 2 thinking"
place fork1 tokens 1 "Fork A"
place fork2 tokens 1 "Fork B"
place eat1 tokens 0 "Phil 1 eating"
place eat2 tokens 0 "Phil 2 eating"
transition T1a
transition T1b
transition T2a
transition T2b
think1 -> T1a
fork1 -> T1a
fork2 -> T1a
T1a -> eat1
eat1 -> T1b
T1b -> think1
T1b -> fork1
T1b -> fork2
think2 -> T2a
fork1 -> T2a
fork2 -> T2a
T2a -> eat2
eat2 -> T2b
T2b -> think2
T2b -> fork1
T2b -> fork2