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 |
plan
program
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, tryWithAnotherGoal
isAlive, setAlive
protected 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)
ProblemSolvingAgent
updateState
in class ProblemSolvingAgent
protected java.lang.Object formulateGoal()
ProblemSolvingAgent
formulateGoal
in class ProblemSolvingAgent
protected Problem formulateProblem(java.lang.Object goal)
ProblemSolvingAgent
formulateProblem
in class ProblemSolvingAgent
protected java.util.List<Action> search(Problem problem)
ProblemSolvingAgent
search
in class ProblemSolvingAgent
protected void notifyViewOfMetrics()