|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.util.Attribute
ptolemy.actor.Director
ptolemy.domains.tester.kernel.TesterDirector
public class TesterDirector
This director does not execute a model, but instead looks for attributes contained by the model at the same level of the hierarchy as this director that implement the Testable interface. If the train parameter is false, it invokes the test() method on them, and otherwise, it invokes the train() method on them. It does everything in preinitialize(). It first invokes preinitialize() on all contained actors, and then runs test() or train() on all contained Testable attributes. If any of those throws an exception, then preinitialize() throws an exception.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
NamedObj.ContainedObjectsIterator |
Field Summary | |
---|---|
Parameter |
trainingMode
Indicator of whether to invoke train() or test() on the Testable objects. |
Fields inherited from class ptolemy.actor.Director |
---|
_actorsFinishedExecution, _currentTime, _finishRequested, _initializables, _stopRequested, timeResolution |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Fields inherited from interface ptolemy.actor.Executable |
---|
COMPLETED, NOT_READY, STOP_ITERATING |
Constructor Summary | |
---|---|
TesterDirector(CompositeEntity container,
java.lang.String name)
Construct a director. |
Method Summary | |
---|---|
void |
addInitializable(Initializable initializable)
Do nothing. |
void |
fire()
Do nothing. |
void |
initialize()
Do nothing. |
boolean |
postfire()
Return false, indicating that we are done. |
boolean |
prefire()
Return true. |
void |
preinitialize()
Override the base class to first invoke preinitialize() on all contained actors and then invoke either test() or train() on all Testable attributes. |
boolean |
transferInputs(IOPort port)
Do nothing. |
boolean |
transferOutputs(IOPort port)
Do nothing. |
void |
wrapup()
Do nothing. |
Methods inherited from class ptolemy.kernel.util.Attribute |
---|
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Parameter trainingMode
Constructor Detail |
---|
public TesterDirector(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name.
IllegalActionException
- If the base class throws it.
NameDuplicationException
- If the base class throws it.Method Detail |
---|
public void addInitializable(Initializable initializable)
addInitializable
in interface Initializable
addInitializable
in class Director
initializable
- The object whose methods should be invoked.Director.removeInitializable(Initializable)
,
CompositeActor.addPiggyback(Executable)
public void fire()
fire
in interface Executable
fire
in class Director
public void initialize()
initialize
in interface Initializable
initialize
in class Director
public boolean postfire()
postfire
in interface Executable
postfire
in class Director
public boolean prefire()
prefire
in interface Executable
prefire
in class Director
public void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
preinitialize
in class Director
IllegalActionException
- If the superclass throws it.public boolean transferInputs(IOPort port)
transferInputs
in class Director
port
- The port to transfer tokens from.
public boolean transferOutputs(IOPort port)
transferOutputs
in class Director
port
- The port to transfer tokens from.
public void wrapup()
wrapup
in interface Initializable
wrapup
in class Director
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |