public class GridSimulationAgent extends SimulationAgentExtend
Constructor and Description |
---|
GridSimulationAgent()
The constructor instantiates the agentstate.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canPush(GridSimulationWorldState simulationstate,
String nextAction,
int x,
int y)
Test, if pushing possible
|
int |
computeProbability(int fap,
int mfap,
int mng,
int ng)
This method computes for each agent his probabilty of action failure
|
FinalPerception |
createFinalPerception(WorldState simstate,
AgentState[] agentstates) |
InitialStickyPerception |
createInitialPerception(WorldState simstate,
AgentState[] agentstates) |
Perception |
createPerception(WorldState simstate,
AgentState[] agentstates) |
AgentState |
getAgentState()
Retrieve agent state.
|
void |
processAction(Action a,
WorldState simstate,
AgentState[] agentstates) |
void |
setAgentParameter(AgentParameter agentpar)
Set agent creation parameter.
|
void |
updateWorldState(WorldState simstate,
SimulationAgent[] agents)
take charge of agent's direction in world state. in the case, two or more
agents wants to move in the same cell, only one of them can move in and the
others will be set back to their old positions. in other words if the first agent
wants to move to the cell, where another agent (also the second) stands. he will try to push the second agent
away in a free cell .the push action can only success when the second agent does not want to
perform a movement in his last simulation step and this simulation step(his actions can be "skip", "invalid" "pick", "drop",
"mark", "unmark").
|
moveAction
getAgent, setAgent
public GridSimulationAgent()
public AgentState getAgentState()
SimulationAgent
public void setAgentParameter(AgentParameter agentpar)
SimulationAgent
setAgentParameter
in interface SimulationAgent
setAgentParameter
in class AbstractSimulationAgent
agentpar
- agent parameters to usepublic Perception createPerception(WorldState simstate, AgentState[] agentstates)
public void processAction(Action a, WorldState simstate, AgentState[] agentstates)
public void updateWorldState(WorldState simstate, SimulationAgent[] agents)
updateWorldState
in class SimulationAgentExtend
simstate
- is the WorldStatepublic boolean canPush(GridSimulationWorldState simulationstate, String nextAction, int x, int y)
nextAction
- x
- y
- public int computeProbability(int fap, int mfap, int mng, int ng)
fap
- failureActionProbabilitymfap
- maxFailureActionProbabilitymng
- maxNumberOfGoldItemsng
- numberOfGoldItems (current)public InitialStickyPerception createInitialPerception(WorldState simstate, AgentState[] agentstates)
public FinalPerception createFinalPerception(WorldState simstate, AgentState[] agentstates)
Copyright © 2013. All Rights Reserved.