de.cesr.lara.components.agents
Interface LaraAgentComponent<A extends LaraAgent<? super A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>

Type Parameters:
A - type of agent this LARA component belongs to
BO - type of behavioural options memorised in the BO-memory
All Superinterfaces:
LaraAbstractEventSubscriber, LaraEnvironmentListener, LaraInternalEventSubscriber
All Known Implementing Classes:
LDefaultAgentComp

public interface LaraAgentComponent<A extends LaraAgent<? super A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>
extends LaraEnvironmentListener, LaraInternalEventSubscriber


Method Summary
 void addPreferenceWeights(LPrefEntry... prefEntry)
          Set the agent's preferenceWeights towards its preferences.
 void addPreferenceWeights(Map<Class<? extends LaraPreference>,Double> preferenceWeights)
          Set the agent's preference weights towards its preferences.
 void decide(LaraDecisionConfiguration dConfiguration)
          Executes decision making for the given LaraDecisionConfiguration: Simulates the agent's decision making process.
 LaraBOMemory<BO> getBOMemory()
          Get the LaraBOMemory (for behavioural options) of this agent.
 LaraDecisionData<A,BO> getDecisionData(LaraDecisionConfiguration dConfiguration)
          Returns the LaraDecisionData object associated with the given LaraDecisionConfiguration.
 Iterable<LaraDecisionData<A,BO>> getDecisionDataIterable()
          Returns an iterator that iterates over all LaraDecisionDatas.
 LaraDeliberativeChoiceComponent getDeliberativeChoiceComp(LaraDecisionConfiguration dConfiguration)
          Returns the LaraDeliberativeChoiceComponent that shall be used for the given decision configuration.
 double getDoubleProperty(String name)
           
 LaraEnvironment getEnvironment()
          Get the environment this agent belongs to by its type
 LaraMemory<LaraProperty<?,?>> getGeneralMemory()
          Get the LaraMemory (for general properties) of this agent.
 int getNumDecisionDataObjects()
          The number of LaraDecisionData objects currently stored at the agent.
 Double getPreferenceWeight(Class<? extends LaraPreference> preference)
           
 Map<Class<? extends LaraPreference>,Double> getPreferenceWeights()
           
 void removeDecisionData(LaraDecisionConfiguration dConfiguration)
          Removes the LaraDecisionData that is associated with the specified LaraDecisionConfiguration.
 void setBOMemory(LaraBOMemory<BO> boMemory)
          Set the agent's behavioural options memory
 void setDeliberativeChoiceComp(LaraDecisionConfiguration dConfiguration, LaraDeliberativeChoiceComponent comp)
          Sets the LaraDeliberativeChoiceComponent that shall be used for the given decision configuration.
 void setDoubleProperty(String name, double value)
           
 void setGeneralMemory(LaraMemory<LaraProperty<?,?>> memory)
          Set the agent's general property memory
 void setPostProcessor(LaraPostprocessorComp<A,BO> postprocesor)
          Sets the post-processor component.
 void setPreprocessor(LaraPreprocessor<A,BO> preprocessor)
          Set the agent's pre-processor.
 
Methods inherited from interface de.cesr.lara.components.environment.LaraEnvironmentListener
envPropertyChanged
 
Methods inherited from interface de.cesr.lara.components.eventbus.LaraInternalEventSubscriber
onInternalEvent
 

Method Detail

addPreferenceWeights

void addPreferenceWeights(LPrefEntry... prefEntry)
Set the agent's preferenceWeights towards its preferences.

Parameters:
prefEntry -

addPreferenceWeights

void addPreferenceWeights(Map<Class<? extends LaraPreference>,Double> preferenceWeights)
Set the agent's preference weights towards its preferences.

Parameters:
preferenceWeights - the preferenceWeights to set

decide

void decide(LaraDecisionConfiguration dConfiguration)
Executes decision making for the given LaraDecisionConfiguration: Simulates the agent's decision making process.

Parameters:
dConfiguration - decision builder that identifies the decision to execute

getBOMemory

LaraBOMemory<BO> getBOMemory()
Get the LaraBOMemory (for behavioural options) of this agent.

Returns:
agent's behavioural option memory

getDecisionData

LaraDecisionData<A,BO> getDecisionData(LaraDecisionConfiguration dConfiguration)
Returns the LaraDecisionData object associated with the given LaraDecisionConfiguration. If the object does not exist, it is created. NOTE: The LDC parameter should not be bounded since it would require the LaraBehaviouralOption (which calls this method) to restricts its agent parameter's BO parameter.

Parameters:
dConfiguration -
Returns:
the decision data associated with the given decision builder.

getDecisionDataIterable

Iterable<LaraDecisionData<A,BO>> getDecisionDataIterable()
Returns an iterator that iterates over all LaraDecisionDatas.

Returns:
the iterator

getDeliberativeChoiceComp

LaraDeliberativeChoiceComponent getDeliberativeChoiceComp(LaraDecisionConfiguration dConfiguration)
Returns the LaraDeliberativeChoiceComponent that shall be used for the given decision configuration.

Parameters:
dConfiguration -
Returns:

getDoubleProperty

double getDoubleProperty(String name)
Parameters:
name - the property's name
Returns:
the double value of that property - NaN if property does not exist

getEnvironment

LaraEnvironment getEnvironment()
Get the environment this agent belongs to by its type

Returns:
environment the agent is embedded in

getGeneralMemory

LaraMemory<LaraProperty<?,?>> getGeneralMemory()
Get the LaraMemory (for general properties) of this agent.

Returns:
agent's general property memory

getNumDecisionDataObjects

int getNumDecisionDataObjects()
The number of LaraDecisionData objects currently stored at the agent.

Returns:
the number of decision data objects

getPreferenceWeight

Double getPreferenceWeight(Class<? extends LaraPreference> preference)
Parameters:
preference -
Returns:
agent's preference weight regarding the given preference

getPreferenceWeights

Map<Class<? extends LaraPreference>,Double> getPreferenceWeights()
Returns:
a map of the agents preferenceWeights

removeDecisionData

void removeDecisionData(LaraDecisionConfiguration dConfiguration)
Removes the LaraDecisionData that is associated with the specified LaraDecisionConfiguration.

Parameters:
dConfiguration -

setBOMemory

void setBOMemory(LaraBOMemory<BO> boMemory)
Set the agent's behavioural options memory

Parameters:
boMemory - the new BO memory

setDeliberativeChoiceComp

void setDeliberativeChoiceComp(LaraDecisionConfiguration dConfiguration,
                               LaraDeliberativeChoiceComponent comp)
Sets the LaraDeliberativeChoiceComponent that shall be used for the given decision configuration. Note: if possible, use the same instance of the LaraDeliberativeChoiceComponent for all agents to save memory.

Parameters:
dConfiguration -
comp -

setDoubleProperty

void setDoubleProperty(String name,
                       double value)
Parameters:
name - the name of existing or new property
value - the property's (new) value

setGeneralMemory

void setGeneralMemory(LaraMemory<LaraProperty<?,?>> memory)
Set the agent's general property memory

Parameters:
memory - agent's general property memory

setPostProcessor

void setPostProcessor(LaraPostprocessorComp<A,BO> postprocesor)
Sets the post-processor component.

Parameters:
postprocesor -

setPreprocessor

void setPreprocessor(LaraPreprocessor<A,BO> preprocessor)
Set the agent's pre-processor.

Parameters:
preprocessor -