public class MapAgent extends ProblemSolvingAgent
SimpleMapAgent which works
correctly also for A* and other best-first search implementations. It can be
extended also for scenarios, in which the agent faces unforeseen events. When
using informed search and more then one goal, make sure, that a heuristic
function factory is provided!| Modifier and Type | Field and Description |
|---|---|
protected int |
currGoalIdx |
protected java.util.List<java.lang.String> |
goals |
protected Map |
map |
protected EnvironmentViewNotifier |
notifier |
protected DynamicState |
state |
planprogram| Constructor and Description |
|---|
MapAgent(Map map,
SearchForActions search,
java.util.List<java.lang.String> goals) |
MapAgent(Map map,
SearchForActions search,
java.util.List<java.lang.String> goals,
EnvironmentViewNotifier notifier) |
MapAgent(Map map,
SearchForActions search,
java.util.List<java.lang.String> goals,
EnvironmentViewNotifier notifier,
HeuristicFunctionFactory hfFactory) |
MapAgent(Map map,
SearchForActions search,
java.lang.String goal) |
MapAgent(Map map,
SearchForActions search,
java.lang.String goal,
EnvironmentViewNotifier notifier) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
formulateGoal()
Primitive operation, responsible for goal generation.
|
protected Problem |
formulateProblem(java.lang.Object goal)
Primitive operation, responsible for search problem generation.
|
protected void |
notifyViewOfMetrics() |
protected java.util.List<Action> |
search(Problem problem)
Primitive operation, responsible for the generation of an action list
(plan) for the given search problem.
|
protected State |
updateState(Percept p)
Primitive operation, responsible for updating the state of the agent with
respect to latest feedback from the world.
|
execute, tryWithAnotherGoalisAlive, setAliveprotected final Map map
protected final DynamicState state
protected final java.util.List<java.lang.String> goals
protected int currGoalIdx
protected EnvironmentViewNotifier notifier
public MapAgent(Map map, SearchForActions search, java.lang.String goal)
public MapAgent(Map map, SearchForActions search, java.lang.String goal, EnvironmentViewNotifier notifier)
public MapAgent(Map map, SearchForActions search, java.util.List<java.lang.String> goals)
public MapAgent(Map map, SearchForActions search, java.util.List<java.lang.String> goals, EnvironmentViewNotifier notifier)
public MapAgent(Map map, SearchForActions search, java.util.List<java.lang.String> goals, EnvironmentViewNotifier notifier, HeuristicFunctionFactory hfFactory)
protected State updateState(Percept p)
ProblemSolvingAgentupdateState in class ProblemSolvingAgentprotected java.lang.Object formulateGoal()
ProblemSolvingAgentformulateGoal in class ProblemSolvingAgentprotected Problem formulateProblem(java.lang.Object goal)
ProblemSolvingAgentformulateProblem in class ProblemSolvingAgentprotected java.util.List<Action> search(Problem problem)
ProblemSolvingAgentsearch in class ProblemSolvingAgentprotected void notifyViewOfMetrics()