JACK 5.4 Application Interface

aos.jack.jak.event
Class Event

java.lang.Object
  extended byaos.jack.jak.util.Watchable
      extended byaos.jack.jak.fsm.FSM
          extended byaos.jack.jak.event.Event
All Implemented Interfaces:
ObservableInt
Direct Known Subclasses:
BDIFactEvent, BDIGoalEvent, InferenceGoalEvent, MessageEvent, ParallelEvent, PlanChoice, TimeSync, UpdateScreen, Visualise

public class Event
extends FSM

Event is a base class for events. All events extend this class.


Field Summary
 Behavior behavior
          The behaviour of this event.
 int priority
          The event priority.
 Plan[] relevant
          The plans relevant for this event.
 aos.jack.jak.task.Task task
          The task that is processing this event.
 
Constructor Summary
Event()
           
 
Method Summary
 Plan computeFirstApplicable()
           
 void dump(java.io.PrintWriter p)
          Utility method for dumping events to a stream.
 java.lang.String getEventName()
          Gets the name of the Event, as a fully qualified Java class name.
 java.lang.Object getVariable(int n)
          Gets the numbered Object variable.
 java.lang.Object getVariable(java.lang.String name)
          Gets the named Object 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 "".
 boolean gotException()
          Returns true if the event got an exception.
 boolean init_sentinel(Agent a)
           
 boolean isFailed()
          Returns true if the event has failed.
 boolean isPassed()
          Returns true if the event has succeeded.
 boolean isRunning()
          Returns true while the event is processing.
 void remove()
           
 java.lang.String stateInfo()
          Describe the events current state.
 java.lang.String[] variableNames()
          Gets a String array of the names of the Object's variables.
 java.lang.String[] variableTypes()
          Gets a String array of the type names of the Object's variables.
 
Methods inherited from class aos.jack.jak.fsm.FSM
describe, discard, exceptionInfo, getAgent, getPreferredPriority, init, loadClass, restart, run, setMode, thrownAnException, toString, traceGoal
 
Methods inherited from class aos.jack.jak.util.Watchable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

task

public transient aos.jack.jak.task.Task task
The task that is processing this event.


relevant

public transient Plan[] relevant
The plans relevant for this event.


behavior

public transient Behavior behavior
The behaviour of this event.


priority

public int priority
The event priority. This is used by the PriorityTaskManager for determining the initial task priority.

Constructor Detail

Event

public Event()
Method Detail

dump

public void dump(java.io.PrintWriter p)
Utility method for dumping events to a stream.


stateInfo

public java.lang.String stateInfo()
Describe the events current state.

Overrides:
stateInfo in class FSM

isPassed

public boolean isPassed()
Returns true if the event has succeeded. This returns false while processing or when the event has failed or got an exception.


isFailed

public boolean isFailed()
Returns true if the event has failed. This returns false while processing or when the event succeeds or got an exception.


gotException

public boolean gotException()
Returns true if the event got an exception. This returns false while processing, and when the event has failed, or succeeded.


isRunning

public boolean isRunning()
Returns true while the event is processing. This returns false after processing, when the event has failed, succeeded or got an exception.


init_sentinel

public boolean init_sentinel(Agent a)

computeFirstApplicable

public Plan computeFirstApplicable()

variableNames

public java.lang.String[] variableNames()
Gets a String array of the names of the Object's variables. The ordinal of a variable in the array is used to access its value with getValue.


variableTypes

public java.lang.String[] variableTypes()
Gets a String array of the type names of the Object'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 Object variable.


getVariable

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


getEventName

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

Returns:
the Java class name of the Event

remove

public void remove()
Overrides:
remove in class FSM

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