EASE.Agents.Engine
Class InstantiatedSM

java.lang.Object
  |
  +--EASE.Agents.Engine.InstantiatedSM

class InstantiatedSM
extends java.lang.Object

Instantiation of a state machine for an agent.

Basically so that different instantiations of the one agent can be in the same state.

Very tightly coupled to State Machine.


Field Summary
private  java.util.Hashtable contracts
          A hashtable passed in from an instantiated manager giving all the current contracts.
private  int currState
           
private  StateMachine sm
           
 
Constructor Summary
InstantiatedSM(StateMachine sm)
           
 
Method Summary
private  boolean allContractsSuccess()
           
private  boolean contractFailing()
           
 boolean execute(java.util.Hashtable params)
          Ask the state machine to try to execute.
 boolean execute(java.util.Hashtable params, java.lang.StringBuffer sb)
          Traceable version of execute
 java.util.Vector getCurrentContracts()
          Vector representing the contracts made in this state.
 java.util.Vector getCurrentFactories()
          Vector of strings representing factories registered in this state.
 java.lang.String getCurrentStateName()
          Get current state name.
 double getOutputSatisfaction(java.lang.String factoryName, java.util.Hashtable params, java.lang.Object proposal)
           
 double getSatisfaction(java.lang.String factoryName, java.util.Hashtable params, java.lang.Object proposal)
          Get the satisfaction of some proposal.
 double getSatisfaction(java.lang.String factoryName, java.util.Hashtable params, java.lang.Object proposal, java.lang.StringBuffer sb)
           
 boolean isFailing()
          Check if this state machine is failing by checking whether the current state is failing.
 boolean isSuccess()
          Check if the agent is/has succeeded by checking whether it is in a success state.
 void setContracts(java.util.Hashtable contracts)
          Allows an instantiated manager to share contract list.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

contracts

private java.util.Hashtable contracts
A hashtable passed in from an instantiated manager giving all the current contracts. If a engineer this stays null

currState

private int currState

sm

private StateMachine sm
Constructor Detail

InstantiatedSM

public InstantiatedSM(StateMachine sm)
Method Detail

getSatisfaction

public double getSatisfaction(java.lang.String factoryName,
                              java.util.Hashtable params,
                              java.lang.Object proposal)
Get the satisfaction of some proposal.


getOutputSatisfaction

public double getOutputSatisfaction(java.lang.String factoryName,
                                    java.util.Hashtable params,
                                    java.lang.Object proposal)

getSatisfaction

public double getSatisfaction(java.lang.String factoryName,
                              java.util.Hashtable params,
                              java.lang.Object proposal,
                              java.lang.StringBuffer sb)

getCurrentFactories

public java.util.Vector getCurrentFactories()
Vector of strings representing factories registered in this state.


getCurrentContracts

public java.util.Vector getCurrentContracts()
Vector representing the contracts made in this state.


getCurrentStateName

public java.lang.String getCurrentStateName()
Get current state name.


execute

public boolean execute(java.util.Hashtable params)
Ask the state machine to try to execute.


execute

public boolean execute(java.util.Hashtable params,
                       java.lang.StringBuffer sb)
Traceable version of execute

isFailing

public boolean isFailing()
Check if this state machine is failing by checking whether the current state is failing.


isSuccess

public boolean isSuccess()
Check if the agent is/has succeeded by checking whether it is in a success state.


setContracts

public void setContracts(java.util.Hashtable contracts)
Allows an instantiated manager to share contract list.

contractFailing

private boolean contractFailing()

allContractsSuccess

private boolean allContractsSuccess()