Package ptolemy.actor.gui
Class MoMLSimpleStatisticalApplication
- java.lang.Object
-
- ptolemy.moml.MoMLSimpleApplication
-
- ptolemy.actor.gui.MoMLSimpleStatisticalApplication
-
- All Implemented Interfaces:
ExecutionListener
,ChangeListener
public class MoMLSimpleStatisticalApplication extends MoMLSimpleApplication
A simple application that reads in a .xml file as a command line argument, runs it and prints out time and memory statisticsMoMLApplication sets the look and feel, which starts up Swing, so we can't use MoMLApplication for non-graphical simulations.
We implement the ChangeListener interface so that this class will get exceptions thrown by failed change requests.
Below is an example use of this class:
java -classpath $PTII ptolemy.actor.gui.MoMLSimpleStatisticalApplication -iterations 2 ../../../ptolemy/domains/sdf/demo/OrthogonalCom/OrthogonalCom.xml
- Since:
- Ptolemy II 2.0
- Version:
- $Id$
- Author:
- Christopher Hylands
- Pt.AcceptedRating:
- Red (eal)
- Pt.ProposedRating:
- Red (cxh)
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String[]
_commandFlags
The command-line options that are either present or not.protected java.lang.String[][]
_commandOptions
The command-line options that take arguments.protected java.lang.String
_commandTemplate
The form of the command line.protected static boolean
_test
If true, then auto exit after a few seconds.-
Fields inherited from class ptolemy.moml.MoMLSimpleApplication
_activeCount, _executionFinishedOrError, _manager, _parser, _sawThrowable, _toplevel, _workspace
-
-
Constructor Summary
Constructors Constructor Description MoMLSimpleStatisticalApplication(java.lang.String[] args)
Parse the xml file and run it.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
_parseArg(java.lang.String arg)
Parse a command-line argument.protected void
_parseArgs(java.lang.String[] args)
Parse the command-line arguments.protected java.lang.String
_usage()
Return a string summarizing the command-line arguments.static void
main(java.lang.String[] args)
Create an instance of a single model and run it.-
Methods inherited from class ptolemy.moml.MoMLSimpleApplication
changeExecuted, changeFailed, cleanup, closeVertx, executionError, executionFinished, managerStateChanged, rerun, toplevel, waitForFinish
-
-
-
-
Field Detail
-
_commandFlags
protected java.lang.String[] _commandFlags
The command-line options that are either present or not.
-
_commandOptions
protected java.lang.String[][] _commandOptions
The command-line options that take arguments.
-
_commandTemplate
protected java.lang.String _commandTemplate
The form of the command line.
-
_test
protected static boolean _test
If true, then auto exit after a few seconds.
-
-
Constructor Detail
-
MoMLSimpleStatisticalApplication
public MoMLSimpleStatisticalApplication(java.lang.String[] args) throws java.lang.Exception
Parse the xml file and run it.- Parameters:
args
- The command line arguments- Throws:
java.lang.Exception
- If there was a problem parsing or running the model.
-
-
Method Detail
-
_parseArg
protected boolean _parseArg(java.lang.String arg) throws java.lang.Exception
Parse a command-line argument.- Parameters:
arg
- The command-line argument to be parsed.- Returns:
- True if the argument is understood, false otherwise.
- Throws:
java.lang.Exception
- If something goes wrong.
-
_parseArgs
protected void _parseArgs(java.lang.String[] args) throws java.lang.Exception
Parse the command-line arguments.- Parameters:
args
- The command-line arguments to be parsed.- Throws:
java.lang.Exception
- If an argument is not understood or triggers an error.
-
main
public static void main(java.lang.String[] args)
Create an instance of a single model and run it.- Parameters:
args
- The command-line arguments naming the .xml file to run
-
_usage
protected java.lang.String _usage()
Return a string summarizing the command-line arguments.- Returns:
- A usage string.
-
-