EASE.Agents.Engine
Class InstantiatedEngineer

java.lang.Object
  |
  +--EASE.Agents.Engine.InstantiatedAgent
        |
        +--EASE.Agents.Engine.InstantiatedEngineer

public class InstantiatedEngineer
extends InstantiatedAgent

An instantiated engineer agent.


Field Summary
private  Debugger debugger
           
private  boolean deregister
           
private  java.util.Vector factories
           
private  boolean first
           
private  boolean killed
           
private  java.util.Vector oldFactories
           
private  boolean register
           
private  GenericEngineer template
           
 
Fields inherited from class EASE.Agents.Engine.InstantiatedAgent
listeners, params, parent, parentPriority, paused, sensingEngine, sm, template, userFailEnded, userSuccessEnded
 
Constructor Summary
InstantiatedEngineer(GenericEngineer template, java.util.Hashtable params, InstantiatedAgent parent)
           
 
Method Summary
 java.util.Vector currentFactories()
           
 java.lang.String deregisterWith()
           
 void endContract()
          Engineer specific contract breaking.
 boolean execute()
          Engineer specific execution.
private  double getOutputSatisfaction(java.lang.String name, java.lang.Object proposal)
           
private  double getSatisfaction(java.lang.String name, java.lang.Object proposal)
           
 ProposeResult propose(java.lang.String name, java.lang.Object proposal)
          This form of propose is called when the factory is not checking output only the new suggestion.
 ProposeResult propose(java.lang.String name, java.lang.Object proposal, java.lang.Object previous)
          Called by the factory to offer two suggestions, the first is a new proposal that the factory has come up with and the second is the previous best solution.
 java.lang.String registerWith()
          This function is called by the agent controller to see if there are any factories that the agent wishes to be registered with.
 java.lang.StringBuffer satisfactionTrace(java.lang.String name, java.lang.Object proposal)
          Tracing
 boolean terminate()
          If this function returns true the agent wants to be terminated.
 
Methods inherited from class EASE.Agents.Engine.InstantiatedAgent
addListener, failing, getName, getParams, getParent, getState, notifyAllChangeListeners, notifyChange, paused, priority, priorityTrace, succeeded, toString, transitionTrace, userEndContract, userPause
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

template

private GenericEngineer template

factories

private java.util.Vector factories

oldFactories

private java.util.Vector oldFactories

debugger

private Debugger debugger

first

private boolean first

killed

private boolean killed

register

private boolean register

deregister

private boolean deregister
Constructor Detail

InstantiatedEngineer

public InstantiatedEngineer(GenericEngineer template,
                            java.util.Hashtable params,
                            InstantiatedAgent parent)
Method Detail

registerWith

public java.lang.String registerWith()
This function is called by the agent controller to see if there are any factories that the agent wishes to be registered with.

Only allows registration with one factory at present.

Returns:
A string with the name of the factory that the agent wishes to be registered with is returned.


deregisterWith

public java.lang.String deregisterWith()

terminate

public boolean terminate()
If this function returns true the agent wants to be terminated.

Returning killed is only a temporary solution.

Overrides:
terminate in class InstantiatedAgent

propose

public ProposeResult propose(java.lang.String name,
                             java.lang.Object proposal,
                             java.lang.Object previous)
Called by the factory to offer two suggestions, the first is a new proposal that the factory has come up with and the second is the previous best solution.

The name of the factory is passed as the first parameter so that the agent knows which suggestion it is dealing with.


propose

public ProposeResult propose(java.lang.String name,
                             java.lang.Object proposal)
This form of propose is called when the factory is not checking output only the new suggestion.


getSatisfaction

private double getSatisfaction(java.lang.String name,
                               java.lang.Object proposal)

getOutputSatisfaction

private double getOutputSatisfaction(java.lang.String name,
                                     java.lang.Object proposal)

satisfactionTrace

public java.lang.StringBuffer satisfactionTrace(java.lang.String name,
                                                java.lang.Object proposal)
Tracing

endContract

public void endContract()
Engineer specific contract breaking.

This does not get rid of the agent just stops it talking to factories.

Overrides:
endContract in class InstantiatedAgent

execute

public boolean execute()
Engineer specific execution.

Returns full if it has an action it wants to perform.

Killed is before first in order to get rid of some problems when agent is contracted and killed in the same step. More general sync problem remains.

Overrides:
execute in class InstantiatedAgent

currentFactories

public java.util.Vector currentFactories()