public class ConvertToLazy extends java.lang.Object implements ChangeListener
$PTII/bin/convertToLazy inputMoML.xml numberOfEntities > outputMoML.xmlor
java -classpath $PTII ptolemy.moml.ConvertToLazy inputMoML.xml numberOfEntities > outputMoML.xmlIf the numberOfEntities argument is not supplied, then it defaults to 100.
Constructor and Description |
---|
ConvertToLazy(java.lang.String xmlFileName,
int threshold)
Parse the xml file and convert it.
|
Modifier and Type | Method and Description |
---|---|
void |
changeExecuted(ChangeRequest change)
React to a change request has been successfully executed by
doing nothing.
|
void |
changeFailed(ChangeRequest change,
java.lang.Exception exception)
React to a change request that has resulted in an exception.
|
void |
convert(TypedCompositeActor actor,
int threshold)
Convert the model.
|
int |
count(TypedCompositeActor actor)
Count the number of contained entities that have not already been made
lazy.
|
static void |
main(java.lang.String[] args)
Create an instance of a model and convert it.
|
public ConvertToLazy(java.lang.String xmlFileName, int threshold) throws java.lang.Throwable
xmlFileName
- A string that refers to an MoML file that
contains a Ptolemy II model. The string should be
a relative pathname.threshold
- The number of contained entities that a composite
should have to be converted to a lazy composite.java.lang.Throwable
- If there was a problem parsing
or running the model.public void changeExecuted(ChangeRequest change)
changeExecuted
in interface ChangeListener
change
- The change that has been executed, or null if
the change was not done via a ChangeRequest.public void changeFailed(ChangeRequest change, java.lang.Exception exception)
changeFailed
in interface ChangeListener
change
- The change that was attempted or null if
the change was not done via a ChangeRequest.exception
- The exception that resulted.public void convert(TypedCompositeActor actor, int threshold)
actor
- The model to convert.threshold
- The threshold to use.public int count(TypedCompositeActor actor)
actor
- The actor to count.public static void main(java.lang.String[] args)
args
- The command-line arguments providing the number
of entities threshold and naming the .xml file to convert.