JACK 5.4 Application Interface

aos.jack.sim.run
Class SimAgent

java.lang.Object
  extended byaos.jack.jak.scheduler.Executee
      extended byaos.jack.jak.agent.Agent
          extended byaos.jack.sim.run.SimAgent
Direct Known Subclasses:
TimeDispatcher, TimeSource

public class SimAgent
extends Agent

An extension of the basic JACK agent class that provides some extra features for agents that exist in a simulation context. [More features may be added in future releases.] Currently the only extensions are flags that signify that: - the agent should be automatically registered with the loader at the start of each simulation run; - the agent's tasks should be terminated at the end of each run.


Field Summary
protected  boolean readyAtStart
          True is the default so that SimAgents created via the scenario definition file remain runnable at the start of subsequent iterations.
protected  boolean stopAtEnd
          True is the default so that any SimAgents created in the scenario definition file will have any outstanding tasks terminated at the end of each simulation iteration.
 
Fields inherited from class aos.jack.jak.agent.Agent
thread_pool, timer
 
Constructor Summary
SimAgent(java.lang.String name)
           
 
Method Summary
 boolean isReadyAtStart()
          If true, it signifies that this entity should be automatically registered with the loader at the start of a run.
 boolean isStopAtEnd()
          If true, it signifies that this entity's tasks (if any) will be terminated by force at the end of each simulation run in order to get it cleaned up and ready for the next run with no outstanding tasks to execute.
 void setReadyAtStart(boolean val)
          Sets whether or not the agent/entity should remain active at the start of a new scenario iteration.
 void setStopAtEnd(boolean val)
          Sets whether or not the entity should keep its running state at the start of the next scenario iteration.
 
Methods inherited from class aos.jack.jak.agent.Agent
__init1, __init2, addToDo, addWaitFor, addWaitFor, bug, changeFocus, describeAllAgents, describeState, discardAllTasks, discardOtherTasks, discardReplies, dump, dump, dump, dumpPlans, dumpToString, findLocalAgent, finish, getAgent, getBasename, getCurrentAgent, getCurrentTask, getKnownEvents, getKnownPlans, getName, getObservable, getReply, getTaskManager, getTraceableInfo, inAgent, initialize, isBlocked, isIdle, name, nEvents, nMessages, nTasks, nTodo, postEvent, postEventAndWait, process, processEvent, processMessage, processTask, processToDo, replied, reply, restartIfIdle, rmToDo, rmWaitFor, send, send, startAgent, toString, trigger, warning
 
Methods inherited from class aos.jack.jak.scheduler.Executee
isPaused, remove, run, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

readyAtStart

protected boolean readyAtStart
True is the default so that SimAgents created via the scenario definition file remain runnable at the start of subsequent iterations. Note: Any agents that are not SimAgents will follow this default behaviour -- they will be registered at the start (and remain registered throughout).


stopAtEnd

protected boolean stopAtEnd
True is the default so that any SimAgents created in the scenario definition file will have any outstanding tasks terminated at the end of each simulation iteration. Note: Any agents that are not SimAgents will follow this default behaviour -- they will have their tasks forcibly terminated at the end of each iteration.

Constructor Detail

SimAgent

public SimAgent(java.lang.String name)
Method Detail

setReadyAtStart

public void setReadyAtStart(boolean val)
Sets whether or not the agent/entity should remain active at the start of a new scenario iteration. The default value of this flag is true.


isReadyAtStart

public boolean isReadyAtStart()
If true, it signifies that this entity should be automatically registered with the loader at the start of a run. If this is set to false, then the entity will not be runnable until it is registered manually during the simulation. This is most useful for entities that are created dynamically during the first simulation run so they can be deactivated without having to go through the overhead of creation and destruction.


setStopAtEnd

public void setStopAtEnd(boolean val)
Sets whether or not the entity should keep its running state at the start of the next scenario iteration. This will ensure that any running tasks are terminated which is important if the simulation run is terminated before all agents are idle. The default value of this flag is true.


isStopAtEnd

public boolean isStopAtEnd()
If true, it signifies that this entity's tasks (if any) will be terminated by force at the end of each simulation run in order to get it cleaned up and ready for the next run with no outstanding tasks to execute.


JACK 5.4 Application Interface

Copyright (C) 1999-2008, Agent Oriented Software Pty. Ltd.

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.


Agent Oriented Software Pty. Ltd.     http://www.aosgrp.com
PO Box 639, Carlton South, Victoria 3053, Australia
Phone: +61 3 9349 5055, Fax: +61 3 9349 5088