|
|
|
|
|
|
INACommandFileGenerator
|
|
|
|
INACommandFileGenerator is an independent Java class, which serves as an interface for Java programs to the Integrated Net Analyser (INA), an interactive, terminal based Petrinet analysis tool. The operation of INA is simplyfied in a way, that it is only necessary to pass the tasks which shall be executed by INA to the generator. The generator creates a command file, which executes the passed tasks regarding a given net (see Using the INACommandFileGenerator). Alternatively, the file SESSION.ina can be read directly, which is produced by INA while the generator is generating the command file. The concrete utilisation of the results is not a task of the generator. To use the INACommandFileGenerator in a Java program, a generator object must be created. The constructor method needs two parameters of the type File. The first one has to declare the path of INA, including the name of the program file. The second path has to refer to an existing directory which is used as the working directory. That means that files needed for the work with INA are written into this directory as well as the files COMMAND.ina and SESSION.ina, which are created by INA. Now you can tell the generator object which tasks shall be performed by INA. You can do this by creating an array of integer values which contains a special value for each task to be performed. By now there are the following tasks available:
So if e.g. the place invariants of the net shall be computed, the array has to contain the value INACommandFileGenerator.DO_P_INVARIANTS. By calling the method setToDo(int[]) at the generator object, the array announces the corresponding tasks. Now at the latest, the net which shall be analysed has to be stored in INA-format as tempnet.pnt in the working directory. This can be done by the program which uses the generator or manually before starting the program. The generator is implemented only for Place/Transition Nets. Thus, other net types can cause errors. Now, you can call the method generateCommandFile(), which actually starts the computation. This method returns an integer value telling wheather generating the command file succeeded or not. This value should be tested exactly before finally using the generated files. The following return values of the method generateCommandFile() are possible:
There is already an application using the generator. It is called InaControl which is an application o the Petri Net Kernel (PNK). For more information see the homepage of the PNK as well as the site with all the implemented PNK applications.
|
|
Yvonne Gabriel
last updated: 19.4.2004 |
|
|