|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.cesr.lara.components.agents.impl.LDefaultAgentComp<A,BO>
A - type of agentBO - the type of behavioural options memorised in the BO memory The
type of agent this agent component belongs topublic class LDefaultAgentComp<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>
| Field Summary | |
|---|---|
protected A |
agent
the agent the component belongs to |
protected LaraBOMemory<BO> |
boMemory
memory for behavioural options |
protected Map<LaraDecisionConfiguration,LaraDecisionData<A,BO>> |
decisionData
the agents decision module |
protected static Map<LaraDecisionConfiguration,LaraDeliberativeChoiceComponent> |
defaultDeliberativeChoiceComponents
Deliberative choice components according to LaraDecisionConfiguration. |
protected Map<LaraDecisionConfiguration,LaraDeliberativeChoiceComponent> |
deliberativeChoiceCompents
Deliberative choice components according to LaraDecisionConfiguration. |
protected Map<String,Double> |
doubleProperties
DODOC describe this feature properties |
protected LaraEnvironment |
environment
environment |
protected LEventbus |
eventBus
|
protected LaraMemory<LaraProperty<?,?>> |
memory
a collection of the agents behavioural options |
protected LaraPostprocessorComp<A,BO> |
postProcessorComp
|
protected Collection<Class<? extends LaraPreference>> |
preferences
a collection of the agents preferenceWeights |
protected Map<Class<? extends LaraPreference>,Double> |
preferenceWeights
a collection of the agents preferenceWeights towards preferenceWeights |
protected LaraPreprocessor<A,BO> |
preprocessor
Since each agent may have different strategies and modes of action selection, each agent is assigned an instance of LaraPreprocessor
. |
protected LaraBOPreselector.Accuracy |
preselectingBOaccuracy
accuracy |
| Constructor Summary | |
|---|---|
LDefaultAgentComp(A agent,
LaraEnvironment env)
Simplest Constructor (e.g. social environment, geographical environment) |
|
| 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 decisionConfig)
Executes decision making for the given LaraDecisionConfiguration:
Simulates the agent's decision making process. |
void |
envPropertyChanged(LAbstractEnvironmentalProperty<?> envProperty)
Called by the LaraEnvironment to inform about property changes. |
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. |
static LaraDeliberativeChoiceComponent |
getDefaultDeliberativeChoiceComp(LaraDecisionConfiguration dConfiguration)
|
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 |
onInternalEvent(LaraEvent event)
LAgentPreprocessEvent: If no LaraPreprocessor was set,
the default preprocessor is set now. |
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 |
static void |
setDefaultDeliberativeChoiceComp(LaraDecisionConfiguration dConfiguration,
LaraDeliberativeChoiceComponent comp)
|
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 class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static Map<LaraDecisionConfiguration,LaraDeliberativeChoiceComponent> defaultDeliberativeChoiceComponents
LaraDecisionConfiguration. Contains default for key NULL.
protected A extends LaraAgent<A,BO> agent
protected Map<LaraDecisionConfiguration,LaraDecisionData<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>> decisionData
protected Map<LaraDecisionConfiguration,LaraDeliberativeChoiceComponent> deliberativeChoiceCompents
LaraDecisionConfiguration. Contains default for key NULL.
protected Collection<Class<? extends LaraPreference>> preferences
protected Map<Class<? extends LaraPreference>,Double> preferenceWeights
protected LaraMemory<LaraProperty<?,?>> memory
protected LaraBOMemory<BO extends LaraBehaviouralOption<?,? extends BO>> boMemory
protected LaraPreprocessor<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>> preprocessor
LaraPreprocessor
. (SH)
protected LaraPostprocessorComp<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>> postProcessorComp
protected LaraEnvironment environment
protected LEventbus eventBus
protected LaraBOPreselector.Accuracy preselectingBOaccuracy
protected Map<String,Double> doubleProperties
| Constructor Detail |
|---|
public LDefaultAgentComp(A agent,
LaraEnvironment env)
agent - env - | Method Detail |
|---|
public static LaraDeliberativeChoiceComponent getDefaultDeliberativeChoiceComp(LaraDecisionConfiguration dConfiguration)
public static void setDefaultDeliberativeChoiceComp(LaraDecisionConfiguration dConfiguration,
LaraDeliberativeChoiceComponent comp)
dConfiguration - comp - public void addPreferenceWeights(LPrefEntry... prefEntry)
LaraAgentComponent
addPreferenceWeights in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>public void addPreferenceWeights(Map<Class<? extends LaraPreference>,Double> preferenceWeights)
LaraAgentComponent
addPreferenceWeights in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>preferenceWeights - the preferenceWeights to setLaraAgentComponent.addPreferenceWeights(java.util.Map)public void decide(LaraDecisionConfiguration decisionConfig)
LaraAgentComponentLaraDecisionConfiguration:
Simulates the agent's decision making process.
decide in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>decisionConfig - decision builder that identifies the decision to executeLaraAgentComponent.decide(de.cesr.lara.components.decision.LaraDecisionConfiguration)public void envPropertyChanged(LAbstractEnvironmentalProperty<?> envProperty)
LaraEnvironmentListenerLaraEnvironment to inform about property changes.
envPropertyChanged in interface LaraEnvironmentListenerenvProperty - Created by Sascha Holzhauer on 10.12.2009LaraEnvironmentListener.envPropertyChanged(de.cesr.lara.components.environment.impl.LAbstractEnvironmentalProperty)public LaraBOMemory<BO> getBOMemory()
LaraAgentComponentLaraBOMemory (for behavioural options) of this agent.
getBOMemory in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>LaraAgentComponent.getGeneralMemory()public LaraDecisionData<A,BO> getDecisionData(LaraDecisionConfiguration dConfiguration)
LaraAgentComponentLaraDecisionData 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.
getDecisionData in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>public Iterable<LaraDecisionData<A,BO>> getDecisionDataIterable()
LaraAgentComponentLaraDecisionDatas.
getDecisionDataIterable in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>LaraAgentComponent.getDecisionDataIterable()public LaraDeliberativeChoiceComponent getDeliberativeChoiceComp(LaraDecisionConfiguration dConfiguration)
LaraAgentComponentLaraDeliberativeChoiceComponent that shall be used
for the given decision configuration.
getDeliberativeChoiceComp in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>LaraAgentComponent.getDeliberativeChoiceComp(de.cesr.lara.components.decision.LaraDecisionConfiguration)public double getDoubleProperty(String name)
getDoubleProperty in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>name - the property's name
public LaraEnvironment getEnvironment()
LaraAgentComponent
getEnvironment in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>LaraAgentComponent.getEnvironment()public LaraMemory<LaraProperty<?,?>> getGeneralMemory()
LaraAgentComponentLaraMemory (for general properties) of this agent.
getGeneralMemory in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>LaraAgentComponent.getGeneralMemory()public int getNumDecisionDataObjects()
LaraAgentComponentLaraDecisionData objects currently stored at the
agent.
getNumDecisionDataObjects in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>LaraAgentComponent.getNumDecisionDataObjects()public Double getPreferenceWeight(Class<? extends LaraPreference> preference)
getPreferenceWeight in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>public Map<Class<? extends LaraPreference>,Double> getPreferenceWeights()
getPreferenceWeights in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>LaraAgentComponent.getPreferenceWeights()public void onInternalEvent(LaraEvent event)
LAgentPreprocessEvent: If no LaraPreprocessor was set,
the default preprocessor is set now. However, it is recommended to use a
global configurator before.
onInternalEvent in interface LaraInternalEventSubscriberT - event - public void removeDecisionData(LaraDecisionConfiguration dConfiguration)
LaraAgentComponentLaraDecisionData that is associated with the
specified LaraDecisionConfiguration.
removeDecisionData in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>LaraAgentComponent.removeDecisionData(de.cesr.lara.components.decision.LaraDecisionConfiguration)public void setBOMemory(LaraBOMemory<BO> boMemory)
LaraAgentComponent
setBOMemory in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>boMemory - the new BO memoryLaraAgentComponent.setBOMemory(de.cesr.lara.components.container.memory.LaraBOMemory)
public void setDeliberativeChoiceComp(LaraDecisionConfiguration dConfiguration,
LaraDeliberativeChoiceComponent comp)
LaraAgentComponentLaraDeliberativeChoiceComponent 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.
setDeliberativeChoiceComp in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>LaraAgentComponent.setDeliberativeChoiceComp(de.cesr.lara.components.decision.LaraDecisionConfiguration,
de.cesr.lara.components.decision.LaraDeliberativeChoiceComponent)
public void setDoubleProperty(String name,
double value)
setDoubleProperty in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>name - the name of existing or new propertyvalue - the property's (new) valuepublic void setGeneralMemory(LaraMemory<LaraProperty<?,?>> memory)
LaraAgentComponent
setGeneralMemory in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>memory - agent's general property memoryLaraAgentComponent.setGeneralMemory(LaraMemory)public void setPostProcessor(LaraPostprocessorComp<A,BO> postprocesor)
LaraAgentComponent
setPostProcessor in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>LaraAgentComponent.setPostProcessor(de.cesr.lara.components.postprocessor.LaraPostprocessorComp)public void setPreprocessor(LaraPreprocessor<A,BO> preprocessor)
LaraAgentComponent
setPreprocessor in interface LaraAgentComponent<A extends LaraAgent<A,BO>,BO extends LaraBehaviouralOption<?,? extends BO>>LaraAgentComponent.setPreprocessor(de.cesr.lara.components.preprocessor.LaraPreprocessor)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||