Package com.embabel.plan.goap
Class GoapWorldState
-
- All Implemented Interfaces:
-
com.embabel.common.core.types.HasInfoString,com.embabel.common.core.types.Timestamped,com.embabel.plan.WorldState
public final class GoapWorldState implements WorldState
Represents the state of the world at any time. World state is just a map. This class exposes operations on the state.
-
-
Constructor Summary
Constructors Constructor Description GoapWorldState(Map<String, ConditionDetermination> state)
-
Method Summary
Modifier and Type Method Description InstantgetTimestamp()final Map<String, ConditionDetermination>getState()final Collection<String>unknownConditions()final Collection<GoapWorldState>withOneChange()Generate all possible changes to the world state where only one condition is changed For each existing condition, generate variants where that condition is flipped to the other values (TRUE -> FALSE and UNKNOWN, FALSE -> TRUE and UNKNOWN, UNKNOWN -> TRUE and FALSE) StringinfoString(Boolean verbose, Integer indent)final GoapWorldStateplus(Pair<String, ConditionDetermination> pair)-
-
Constructor Detail
-
GoapWorldState
GoapWorldState(Map<String, ConditionDetermination> state)
-
-
Method Detail
-
getTimestamp
Instant getTimestamp()
-
getState
final Map<String, ConditionDetermination> getState()
-
unknownConditions
final Collection<String> unknownConditions()
-
withOneChange
final Collection<GoapWorldState> withOneChange()
Generate all possible changes to the world state where only one condition is changed For each existing condition, generate variants where that condition is flipped to the other values (TRUE -> FALSE and UNKNOWN, FALSE -> TRUE and UNKNOWN, UNKNOWN -> TRUE and FALSE)
-
infoString
String infoString(Boolean verbose, Integer indent)
-
plus
final GoapWorldState plus(Pair<String, ConditionDetermination> pair)
-
-
-
-