Class Check
- java.lang.Object
-
- ptolemy.domains.csp.demo.DiningPhilosophers.checkDeadlock.Check
-
public class Check extends java.lang.Object
Check the dining philosopher model.Construct the interface automata model for the dining philosopher demo and check for deadlock.
The primitive components in the model are: CSPReceiver, ConditionalSend, ConditionalBranchController, Philosopher, and Chopstick. It is assumed that the MoML files for these models are in the current directory.
The number of philosophers around the dining table can be controlled on the command line. The usage is:
java ptolemy.domains.csp.demo.DiningPhilosophers.checkDeadlock.Check numberOfPhilosophers useSimple
The useSimple argument is either "simple" or "full", indicating if the simple or the full conditional send model is used. This argument is optional. The default is simple.
- Version:
- $Id$
- Author:
- Yuhong Xiong
- Pt.AcceptedRating:
- Red
- Pt.ProposedRating:
- Red (yuhong)
-
-
Constructor Summary
Constructors Constructor Description Check(int numberOfPhilosophers, boolean useSimple)
Load the base automata.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
go()
Compose the automata and check for deadlock.static void
main(java.lang.String[] args)
Obtain the command line arguments and create a checker.
-
-
-
Constructor Detail
-
Check
public Check(int numberOfPhilosophers, boolean useSimple) throws java.lang.Exception
Load the base automata.- Parameters:
numberOfPhilosophers
- The number of philosophers.useSimple
- True if SimpleSend.xml is to be used- Throws:
java.lang.Exception
- If the automata cannot be loaded.
-
-
Method Detail
-
go
public void go() throws IllegalActionException, NameDuplicationException
Compose the automata and check for deadlock.- Throws:
IllegalActionException
- If the automata cannot be composed.NameDuplicationException
- If name clashes during composition.
-
main
public static void main(java.lang.String[] args)
Obtain the command line arguments and create a checker.- Parameters:
args
- The command line arguments. The first argument is the number of philosophers, the second is "simple" or "full", indicating if the simple or the full version of conditional send model is used. The second argument is optional, the default is simple.
-
-