JACK 5.4 Application Interface

aos.jack.jak.plan
Class Plan

java.lang.Object
  extended byaos.jack.jak.plan.Plan
Direct Known Subclasses:
DefaultTeamStart, Run, ScreenUpdater, SimulationStartTransition, TimeControlHandshake, TimeControlLoop, TimeControlPropagate, TimeFlowBusyStepResponse, TimeFlowIdleStepResponse, TimeFlowNonStepResponse, TimeFlowTickStepResponse, TimeSyncDelay, VisualisationEngine

public abstract class Plan
extends java.lang.Object

Plan is base class for JACK plans.


Constructor Summary
Plan()
           
 
Method Summary
 Cursor after(double time)
          Creates a Cursor that becomes true at a given time.
 Cursor after(double time, Timer tm)
          Creates a Cursor that becomes true at a given time, according to the 'tm' Timer.
 Cursor afterMillis(long time)
          Creates a Cursor that becomes true at a given time.
 Cursor afterMillis(long time, Timer tm)
          Creates a Cursor that becomes true at a given time according to the 'tm' Timer.
abstract  aos.jack.jak.plan.PlanFSM body()
          Overridden by code generated by the JACK compiler.
 Cursor context()
          Default context method for plans that define no context method of their own.
 java.lang.String describe()
          Method called to describe a plan and can be used for printing error messages.
 Cursor elapsed(double time)
          Creates a Cursor that becomes true when some time has elapsed.
 Cursor elapsed(double time, Timer tm)
          Creates a Cursor that becomes true when some time has elapsed according to the given Timer.
 Cursor elapsedMillis(long time)
          Creates a Cursor that becomes true when some time has elapsed.
 Cursor elapsedMillis(long time, Timer tm)
          Creates a Cursor that becomes true when some time has elapsed.
 aos.jack.jak.plan.PlanFSM fail()
          Default fail() method for plans that declare no fail method of their own.
 Agent getAgent()
          Used to access the agent in which the plan is running.
 PlanInstanceInfo getInstanceInfo()
          Used to retrieve information about the instance of the plan
 aos.jack.jak.rvt.MonitorID getMonitor()
           
 java.lang.String getPlanName()
          Gets the name of the Plan, as a fully qualified Java class name.
 Signature getSignature()
           
 java.lang.Object getVariable(int n)
          Gets the numbered Plan variable.
 java.lang.Object getVariable(java.lang.String name)
          Gets the named Plan variable.
 java.lang.String getVariableValue(int n)
          Converts the value of the numbered variable to a String as if it had been appended to "".
 java.lang.String getVariableValue(java.lang.String name)
          Converts the value of the named variable to a String as if it had been appended to "".
 java.lang.String handledEvent()
           
 boolean isSame(aos.jack.jak.trace.PlanIntrospection that)
          Tests if the underlying object represents the same Plan instance as this one.
 java.lang.String[] logSignatureVariableTypes()
          Gets a String array of the type names of the Plan's logical signature variables.
 java.lang.String[] objSignatureVariableNames()
          Gets a String array of the names of the Plan's non-logical signature variables.
 java.lang.String[] objSignatureVariableTypes()
          Gets a String array of the type names of the Plan's non-logical signature variables.
 aos.jack.jak.plan.PlanFSM pass()
          Default pass() method for plans that declare no pass method of their own.
 java.lang.String[] reasoningMethods()
          Gets a String array of the names of the Plan's reasoning methods.
 java.lang.String toString()
          Returns the plan name.
 java.lang.String[] variableNames()
          Gets a String array of the names of the Plan's variables.
 java.lang.String[] variableTypes()
          Gets a String array of the type names of the Plan's variables.
 void warning(java.lang.String s)
          Utility method for producing qualified warnings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Plan

public Plan()
Method Detail

getMonitor

public aos.jack.jak.rvt.MonitorID getMonitor()

toString

public java.lang.String toString()
Returns the plan name.


warning

public void warning(java.lang.String s)
Utility method for producing qualified warnings


variableNames

public java.lang.String[] variableNames()
Gets a String array of the names of the Plan's variables.


variableTypes

public java.lang.String[] variableTypes()
Gets a String array of the type names of the Plan's variables. The ordering in the array matches that returned by variableNames.


getVariableValue

public java.lang.String getVariableValue(int n)
Converts the value of the numbered variable to a String as if it had been appended to "".

Returns:
the numbered variable appended to "" or "NOT FOUND" if the index is out of range.

getVariableValue

public java.lang.String getVariableValue(java.lang.String name)
Converts the value of the named variable to a String as if it had been appended to "".

Returns:
the named variable appended to "" or "NOT FOUND" if the variable does not exist

getVariable

public java.lang.Object getVariable(int n)
Gets the numbered Plan variable.


getVariable

public java.lang.Object getVariable(java.lang.String name)
Gets the named Plan variable.


getPlanName

public java.lang.String getPlanName()
Gets the name of the Plan, as a fully qualified Java class name.

Returns:
the Java class name of the Plan

isSame

public boolean isSame(aos.jack.jak.trace.PlanIntrospection that)
Tests if the underlying object represents the same Plan instance as this one.

For a Plan, no other Object is the same. It's only the same as itself.

Returns:
true if this and that represent the same Plan instance

logSignatureVariableTypes

public java.lang.String[] logSignatureVariableTypes()
Gets a String array of the type names of the Plan's logical signature variables. The ordering in the array matches that returned by logSignatureVariableNames.


objSignatureVariableNames

public java.lang.String[] objSignatureVariableNames()
Gets a String array of the names of the Plan's non-logical signature variables. The ordinal of a variable in the array is used to access its value internally in Signature so it is essential that the Signature construction agrees with this.


objSignatureVariableTypes

public java.lang.String[] objSignatureVariableTypes()
Gets a String array of the type names of the Plan's non-logical signature variables. The ordering in the array matches that returned by objSignatureVariableNames.


reasoningMethods

public java.lang.String[] reasoningMethods()
Gets a String array of the names of the Plan's reasoning methods.


getAgent

public Agent getAgent()
Used to access the agent in which the plan is running. A preferred alternative is to use:
#uses interface InterfaceName ref

Returns:
The agent executing the plan.

getInstanceInfo

public PlanInstanceInfo getInstanceInfo()
Used to retrieve information about the instance of the plan

Returns:
a PlanInstanceInfo object with information about the plan.

describe

public java.lang.String describe()
Method called to describe a plan and can be used for printing error messages. Can be overriden to provide more specific information.


handledEvent

public java.lang.String handledEvent()
Returns:
The full name of the class of the handled event.

context

public Cursor context()
Default context method for plans that define no context method of their own. Normally overridden by code generated by the JACK compiler.

Returns:
null

body

public abstract aos.jack.jak.plan.PlanFSM body()
Overridden by code generated by the JACK compiler.


pass

public aos.jack.jak.plan.PlanFSM pass()
Default pass() method for plans that declare no pass method of their own. Normally overridden by code generated by the JACK compiler.

Returns:
null

fail

public aos.jack.jak.plan.PlanFSM fail()
Default fail() method for plans that declare no fail method of their own. Normally overridden by code generated by the JACK compiler.

Returns:
null

elapsedMillis

public Cursor elapsedMillis(long time,
                            Timer tm)
Creates a Cursor that becomes true when some time has elapsed.

Parameters:
time - The time to elapse
tm - The timer with which to measure the passage of time.
Returns:
a cursor that will become true when the time has elapsed.

elapsedMillis

public Cursor elapsedMillis(long time)
Creates a Cursor that becomes true when some time has elapsed. Uses the enclosing agent's timer.

Parameters:
time - The time to elapse.
Returns:
a cursor that will become true when the time has elapsed.

afterMillis

public Cursor afterMillis(long time,
                          Timer tm)
Creates a Cursor that becomes true at a given time according to the 'tm' Timer.

Parameters:
time - The absolute time to wait until.
Returns:
A cursor that will become true at the correct time.

afterMillis

public Cursor afterMillis(long time)
Creates a Cursor that becomes true at a given time. Uses the enclosing agent's timer.

Parameters:
time - the absolute time to wait until.
Returns:
A cursor that will become true at the correct time.

elapsed

public Cursor elapsed(double time)
Creates a Cursor that becomes true when some time has elapsed. Uses the enclosing agent's timer.

Parameters:
time - The elapsed time to wait.
Returns:
A cursor that will become true after the correct amount of time has elapsed.

elapsed

public Cursor elapsed(double time,
                      Timer tm)
Creates a Cursor that becomes true when some time has elapsed according to the given Timer.

Parameters:
time - The elapsed time to wait.
tm - The timer to use to measure the passage of time.
Returns:
A cursor that will become true after the correct amount of time has passed.

after

public Cursor after(double time)
Creates a Cursor that becomes true at a given time. Uses the enclosing agent's timer.

Parameters:
time - The absolute time to wait until.
Returns:
A cursor that will become true at the correct time.

after

public Cursor after(double time,
                    Timer tm)
Creates a Cursor that becomes true at a given time, according to the 'tm' Timer.

Parameters:
time - The absolute time to wait until.
tm - The timer to use to measure the time.
Returns:
A cursor that will become true at the correct time.

getSignature

public Signature getSignature()
Returns:
The plan Signature.

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