de.cesr.lara.components.agents.impl
Class LAbstractAgent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,BO>>

java.lang.Object
  extended by de.cesr.lara.components.agents.impl.LAbstractAgent<A,BO>
Type Parameters:
A -
BO - the type of behavioural options the BO-memory of this agent may store
All Implemented Interfaces:
LaraAgent<A,BO>, LaraAbstractEventSubscriber, LaraEventSubscriber

public abstract class LAbstractAgent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,BO>>
extends Object
implements LaraAgent<A,BO>

TODO logging


Field Summary
protected  LaraAgentComponent<A,BO> agentComp
          AgentComponent
protected  String id
          id as String
 
Constructor Summary
LAbstractAgent(LaraEnvironment env)
           
LAbstractAgent(LaraEnvironment env, String id)
          To initialise the LaraAgentComponent properly the id needs to passed to this constructor.
 
Method Summary
 void clean(LaraDecisionConfiguration dConfiguration)
          Removes the LaraDecisionData according to the specified LaraDecisionConfiguration.
 void customClean(LaraDecisionConfiguration dConfiguration)
          Called by clean(LaraDecisionConfiguration) Created by Sascha Holzhauer on 12.10.2010
 boolean equals(Object o)
          Compares the agent IDs
 String getAgentId()
          Get the custom agent id.
 LaraAgentComponent<A,BO> getLaraComp()
          Returns the LaraAgentComponent of this agent.
abstract  A getThis()
          Must be implemented in subclasses when the agent type parameter gets concrete.
 int hashCode()
           
 void laraExecute(LaraDecisionConfiguration dConfiguration)
          hook method...
static void resetCounter()
          Resets the counter used to label agents (agentID)
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.cesr.lara.components.eventbus.LaraEventSubscriber
onEvent
 

Field Detail

id

protected String id
id as String


agentComp

protected LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,BO>> agentComp
AgentComponent

Constructor Detail

LAbstractAgent

public LAbstractAgent(LaraEnvironment env)
Parameters:
env -

LAbstractAgent

public LAbstractAgent(LaraEnvironment env,
                      String id)
To initialise the LaraAgentComponent properly the id needs to passed to this constructor.

Parameters:
env -
id -
Method Detail

resetCounter

public static void resetCounter()
Resets the counter used to label agents (agentID)


clean

public final void clean(LaraDecisionConfiguration dConfiguration)
Removes the LaraDecisionData according to the specified LaraDecisionConfiguration.

See Also:
de.cesr.lara.components.agents.LaraAgent#clean(de.cesr.lara.components.decision.LaraDecisionConfiguration)

customClean

public void customClean(LaraDecisionConfiguration dConfiguration)
Called by clean(LaraDecisionConfiguration) Created by Sascha Holzhauer on 12.10.2010

Parameters:
dConfiguration -

equals

public boolean equals(Object o)
Compares the agent IDs

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

getAgentId

public final String getAgentId()
Description copied from interface: LaraAgent
Get the custom agent id.

Specified by:
getAgentId in interface LaraAgent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,BO>>
Returns:
agent id string
See Also:
LaraAgent.getAgentId()

getLaraComp

public LaraAgentComponent<A,BO> getLaraComp()
Description copied from interface: LaraAgent
Returns the LaraAgentComponent of this agent.

Specified by:
getLaraComp in interface LaraAgent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,BO>>
Returns:
component Lara agent component
See Also:
LaraAgent.getLaraComp()

getThis

public abstract A getThis()
Must be implemented in subclasses when the agent type parameter gets concrete.

Returns:
reference to this object of the agent parameter's type

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Returns:
the agentID's hash code
See Also:
Object.hashCode()

laraExecute

public void laraExecute(LaraDecisionConfiguration dConfiguration)
hook method...

See Also:
de.cesr.lara.components.agents.LaraAgent#laraExecute(de.cesr.lara.components.decision.LaraDecisionConfiguration)

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()