|
JACK 5.4 Application Interface | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectaos.jack.sim.run.Loader
The Loader class is the entry point for most JACK Sim applications. It has a main() method, which should be passed the name of a simulation scenario definition file.
Field Summary | |
aos.apib.TypeDict |
dict
The JACOB input stream dictionary used when loading scenario definition files. |
static boolean |
exit_when_done
This gets set indirectly, based on the value of TimeDispatcher.exit_on_idle. |
static Timer |
sim_timer
This is the simulation time timer. |
static Timer |
timer
The original JACK Kernel timer is stored here. |
Constructor Summary | |
Loader()
|
Method Summary | |
void |
addAgent(java.lang.String name,
java.lang.String type,
InitialData data)
Deprecated method, retained for backwards compatability. |
void |
addBlocking(Agent agent)
Deprecated method used to block an agent. |
void |
addEntity(java.lang.String name,
java.lang.Object e)
Add an entity (usually an agent) to this loader. |
void |
addModel(java.lang.String name,
java.lang.Object m)
Add a (visual) model to this loader. |
void |
addReflected(java.lang.String name,
java.lang.String type,
InitialData data)
|
boolean |
addTypeDict(java.lang.String d)
|
void |
blockAgent(Agent agent)
Utility method used to block an agent from doing any processing until unblockAgent(agent) is called. |
Agent |
createAgent(java.lang.String name,
java.lang.String type)
Utility method to dynamically create a new (uninitialised) agent that can be registered with the loader. |
Monitor |
createMonitor(java.lang.String type,
int iterations)
|
Agent |
deploy(java.lang.String name,
java.lang.String type,
InitialData data)
Utility method to deploy a (possibly) new agent into a running simulation. |
static void |
deregisterEntities()
This will de-register from the loader any entity that is derived from aos.jack.sim.run.SimAgent and returns "true" via the SimAgent.getIsTransient() method. |
Cursor |
enumerator(Variable v)
A JACK Cursor for enumerating entities. |
java.lang.Object[] |
getEntities()
Returns the current set of entities as an Object array. |
java.lang.Object |
getEntity(java.lang.String name)
Returns the object (entity) associated with the given name. |
java.lang.String[] |
getEntityNames()
Returns the current set of entities as an array of names. |
static Loader |
getLoader()
Return the loader that is currently being used for agent creation/initialisation. |
Monitor |
getMonitor()
Return the monitor object which controls multiple iterations of the current scenario. |
Agent |
initAgent(Agent agent,
InitialData data)
handles local initialisation. |
boolean |
isAgentBlocked(Agent agent)
Utility method used to check if an agent is currently blocked. |
void |
load(java.lang.String filename)
A support method to load a single scenario definition file. |
static void |
main(java.lang.String[] args)
Application entry point. |
Agent |
newAgent(java.lang.String name,
java.lang.String type,
InitialData data)
Utility method to create an agent. |
void |
process(aos.apib.Base b)
|
Agent |
readyAgent(Agent agent,
java.lang.String name,
InitialData data)
Utility method to register a previously created agent. |
Agent |
readyInitAgent(java.lang.String name,
java.lang.String type,
InitialData data)
Utility method to possibly create and initialise an agent and also register it with the loader if it is not already registered. |
Agent |
readyInitExistingAgent(java.lang.String name,
InitialData data)
Utility method to register a named agent with the loader. |
Agent |
readyNewAgent(java.lang.String name,
java.lang.String type,
InitialData data)
Utility method to create an agent and add it to the list of registered entities. |
boolean |
release(java.lang.String name)
Deprecated method used to unblock an agent blocked by a call to addBlocking(). |
void |
removeAgent(Agent agent)
Utility method to deregister an agent from the loader. |
void |
removeEntity(java.lang.String name)
Utility method to remove a previously added entity. |
long |
resetTime()
Reset the clock to the starting time as specified in the current scenario. |
static void |
restart()
|
static void |
start(java.lang.String[] args)
Called by Loader.main() to initialise JACK Sim and begin to load scenario definition files. |
static void |
stopCurrentRun()
A convenience method for terminating the current simulation run and continuing with the next iteration. |
static void |
terminateTasks()
This goes through the entire list of registered entities. |
void |
unblockAgent(Agent agent)
Utility method used to unblock an agent blocked by a call to blockAgent() or the deprecated, addBlocking(). |
boolean |
unblockByName(java.lang.String name)
Utility method used to unblock an entity blocked by a call to blockAgent() or the deprecated, addBlocking(). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static Timer timer
public static Timer sim_timer
public static boolean exit_when_done
public aos.apib.TypeDict dict
Constructor Detail |
public Loader()
Method Detail |
public static void main(java.lang.String[] args)
public long resetTime()
public Monitor getMonitor()
public static void stopCurrentRun()
public static void terminateTasks()
public static void deregisterEntities()
public static Loader getLoader()
public static void restart()
public static void start(java.lang.String[] args)
public void load(java.lang.String filename)
public void process(aos.apib.Base b)
public boolean addTypeDict(java.lang.String d)
public void addModel(java.lang.String name, java.lang.Object m)
public void addEntity(java.lang.String name, java.lang.Object e)
public void removeEntity(java.lang.String name)
public void addBlocking(Agent agent)
public void blockAgent(Agent agent)
public void unblockAgent(Agent agent)
public boolean release(java.lang.String name)
public boolean unblockByName(java.lang.String name)
name
- This should be a simple, unqualified entity name.public boolean isAgentBlocked(Agent agent)
public void removeAgent(Agent agent)
public Agent readyAgent(Agent agent, java.lang.String name, InitialData data)
public Agent createAgent(java.lang.String name, java.lang.String type)
public Agent newAgent(java.lang.String name, java.lang.String type, InitialData data)
public Agent readyNewAgent(java.lang.String name, java.lang.String type, InitialData data)
public void addAgent(java.lang.String name, java.lang.String type, InitialData data)
readyNewAgent(name, type, data)
.
public Agent initAgent(Agent agent, InitialData data)
public Agent readyInitAgent(java.lang.String name, java.lang.String type, InitialData data)
public Agent readyInitExistingAgent(java.lang.String name, InitialData data)
public Agent deploy(java.lang.String name, java.lang.String type, InitialData data)
public void addReflected(java.lang.String name, java.lang.String type, InitialData data)
public Monitor createMonitor(java.lang.String type, int iterations)
public java.lang.Object[] getEntities()
public java.lang.String[] getEntityNames()
public java.lang.Object getEntity(java.lang.String name)
public Cursor enumerator(Variable v)
|
JACK 5.4 Application Interface | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
US Government Restricted Rights
The JACK Modules and relevant Software Material have been developed entirely at private expense and are accordingly provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013 or subparagraph (c)(1) and (2) of the Commercial Computer Software Restricted Rights and 48 CFR 52.2270-19, as applicable.