|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.cesr.lara.houseplant.Agent
public class Agent
As we do agent based modeling the agent makes up the heart of our model. The agent implements the interface LaraAgent - this is neceassary to provide an abstract view of the agent the LARA architecture can interact with.
Constructor Summary | |
---|---|
Agent(String id,
String habitationId,
LaraEnvironment environment,
Map<Class<? extends LaraPreference>,Double> preferences)
creates an agent. requires a unique identifier string |
Method Summary | ||
---|---|---|
void |
decide(LaraDecisionConfiguration dBuilder)
this is called in the end of an decision process. the agent looks for the best decision and acts according to the decision he made. in our case he memorizes his decision. |
|
void |
execute(LaraDecisionConfiguration dBuilder)
Do some actions based on the agents decision. |
|
String |
getAgentId()
Get the custom agent id. |
|
double |
getCurrentAmountOfWaterOfHouseplant()
|
|
int |
getCurrentSunshineDuration()
|
|
LaraAgentComponent<Agent,AbstractIrrigationBehaviouralOption<Agent>> |
getLaraComp()
Returns the LaraAgentComponent of this agent. |
|
double |
getPercentageOfCollaboratorsWhoIrrigatedLastTimestep()
|
|
boolean |
isDecisionDeliberative()
Is called during the preProcess phase. |
|
boolean |
isPlantOk()
does the agent consider the plant to be ok? |
|
|
onEvent(T event)
react on events based on the type of the event |
|
void |
perceive(LaraDecisionConfiguration dBuilder)
perceive the relevant environmental properties (sunshine, what did others do and amount of water) |
|
void |
setLaraComp(LaraAgentComponent<Agent,AbstractIrrigationBehaviouralOption<Agent>> component)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Agent(String id, String habitationId, LaraEnvironment environment, Map<Class<? extends LaraPreference>,Double> preferences)
id
- Method Detail |
---|
public boolean isPlantOk()
public int getCurrentSunshineDuration()
public double getPercentageOfCollaboratorsWhoIrrigatedLastTimestep()
public String getAgentId()
LaraAgent
getAgentId
in interface LaraAgent<Agent,AbstractIrrigationBehaviouralOption<Agent>>
LaraAgent.getAgentId()
public LaraAgentComponent<Agent,AbstractIrrigationBehaviouralOption<Agent>> getLaraComp()
LaraAgent
LaraAgentComponent
of this agent.
getLaraComp
in interface LaraAgent<Agent,AbstractIrrigationBehaviouralOption<Agent>>
LaraAgent.getLaraComp()
public void decide(LaraDecisionConfiguration dBuilder)
public void execute(LaraDecisionConfiguration dBuilder)
public void perceive(LaraDecisionConfiguration dBuilder)
public boolean isDecisionDeliberative()
public <T extends LaraEvent> void onEvent(T event)
onEvent
in interface LaraEventSubscriber
public void setLaraComp(LaraAgentComponent<Agent,AbstractIrrigationBehaviouralOption<Agent>> component)
component
- public double getCurrentAmountOfWaterOfHouseplant()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |