Package eu.iv4xr.framework.mainConcepts
Class Iv4xrAgentState<NavgraphNode>
java.lang.Object
nl.uu.cs.aplib.mainConcepts.SimpleState
nl.uu.cs.aplib.agents.State
eu.iv4xr.framework.mainConcepts.Iv4xrAgentState<NavgraphNode>
- Direct Known Subclasses:
MyAgentState
,W3DAgentState
Representing the state of an iv4xr agent. It extends the class
State
. As such, we can then attach a Prolog
reasoner to this state. See State
.
The new features of this class is that it also holds a representation of the
state of the target world. This is represented as an instance of
WorldModel
. And, along with it it can also hold a navigation graph to
facilitate automated navigation over the target world.
The type paremeter NavgraphNode represents the type of the nodes in worldNavigation
, or the type
that is used to identify the nodes.
- Author:
- Wish
-
Field Summary
Modifier and TypeFieldDescriptionRepresenting the current state of the target world.A navigation graph for navigating the the target world. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionenv()
Return theEnvironment
associated with the state.static void
loadSimpleNavGraph(Iv4xrAgentState<Integer> state)
If the environment attached to the given state has a navigation/surface-mesh, this method converts the mesh into a navigation graph.static void
loadSimpleNavGraph(Iv4xrAgentState<Integer> state, Mesh mesh)
Covert the given surface-mesh into a navigation graph.static void
loadSurfaceNavGraph(Iv4xrAgentState<Integer> state, float faceAreaThresholdToAddCenterNode)
If the environment attached to the given state has a navigation/surface-mesh, this method converts the mesh into a navigation graph.static void
loadSurfaceNavGraph(Iv4xrAgentState<Integer> state, Mesh mesh, float faceAreaThresholdToAddCenterNode)
Covert the given surface-mesh into a navigation graph.setEnvironment(Environment env)
Link the given environment to this State.setWorldNavigation(Navigatable<NavgraphNode> navgraph)
void
updateState(String agentId)
This will call the observe() method of the environment attached to this state to obtain a fresh observation, and then uses it to update this state.Return the value inworldmodel
.Return the navigation-graph inworldNavigation
.Methods inherited from class nl.uu.cs.aplib.agents.State
attachProlog, messenger, prolog
Methods inherited from class nl.uu.cs.aplib.mainConcepts.SimpleState
log, owner
-
Field Details
-
worldmodel
Representing the current state of the target world.
-
-
Constructor Details
-
Iv4xrAgentState
public Iv4xrAgentState()
-
-
Method Details
-
env
Description copied from class:SimpleState
Return theEnvironment
associated with the state.- Overrides:
env
in classSimpleState
-
worldmodel
Return the value inworldmodel
.- Returns:
-
setEnvironment
Link the given environment to this State. An instance ofIv4xrEnvironment
is needed as the environment.- Overrides:
setEnvironment
in classSimpleState
- Parameters:
env
- The Environment we want to associate with this state.- Returns:
- The method simply returns this state to allow it to be used in the Fluent Interface style.
-
updateState
This will call the observe() method of the environment attached to this state to obtain a fresh observation, and then uses it to update this state. Ifworldmodel
exists, this new observation will be merged into theworldmodel
.- Overrides:
updateState
in classSimpleState
-