A class representing the planner state.
The state consists of WorldObjects. The planner aims to find the most cost-effective path from the initial state to the goal state.
The WorldState also determines action-related aspects such as their legality. WorldStates can be modified through applying actions' effects.
More...
|
| | WorldState (WorldState other) |
| | Constructs a new WorldState object that is a copy of the provided WorldState object.
Apart from the domain, it will perform deep copying. More...
|
| |
| | WorldState (Domain domain, List< WorldObject > objects) |
| | Constructs a new WorldState object based on a domain and initial objects. More...
|
| |
|
override bool | Equals (object obj) |
| |
|
override int | GetHashCode () |
| |
| WorldObject | GetObjectByIndex (int index) |
| | Retrieves an existing WorldObject stored at the provided index. The index serves as a unique ID. More...
|
| |
| WorldObject | AddObject (string typeName) |
| | Creates a new WorldObject of the provided type and queues it for adding to the WorldState. The addition will be executed at the end of the current planner iteration.
The object will be created with default parameters which you can change later. More...
|
| |
| void | RemoveObject (int objectIndex) |
| | Adds the object specified by objectIndex to the set of objects that should be removed at the end of the current planner iteration. More...
|
| |
|
List< WorldObject > | GetObjectsOfType (string typeName) |
| |
|
int | CountObjectsOfType (string typeName) |
| | - Returns
- The number of objects of given type, including all derived types.
|
| |
|
override string | ToString () |
| |
| void | MergeParameters (ParametrizedObject other) |
| | Adds parameters from the other object to the own one, replacing parameters with those of other in case of conflict. More...
|
| |
|
int | GetParametersSize () |
| | - Returns
- The number of parameters assigned to this object
|
| |
|
bool | Contains (string name) |
| | - Returns
- true if the object contains a parameter with the given name, false otherwise
|
| |
| void | SetParameter< ParameterType > (string name, ParameterType value) |
| | Sets a value of a parameter identified by the given name. More...
|
| |
| ParameterType | GetParameterValue< ParameterType > (string name) |
| | Fetches the value of a parameter identified with the given name as a given ParameterType. Make sure to provide the correct ParameterType. More...
|
| |
| bool | CollectionContains (string collectionName, int objectIndex) |
| |
| void | AddCollection (string collectionName) |
| | Creates a named collection object, which can be used to group many IDs of objects together.
The name should be unique or you will otherwise override an existing collection. More...
|
| |
| SortedSet< int > | GetCollection (string collectionName) |
| |
|
bool | HasEqualParams (ParametrizedObject other) |
| | - Returns
true if the other object contains identical set of parameters (including the contents of collections)
|
| |
|
| Dictionary< int, WorldObject > | Objects => objects |
| | Returns a dictionary of WorldObjects: the building blocks of the state. More...
|
| |
| Domain | Domain => domain |
| | Gets the domain of the same planning problem as this state corresponds to. More...
|
| |
A class representing the planner state.
The state consists of WorldObjects. The planner aims to find the most cost-effective path from the initial state to the goal state.
The WorldState also determines action-related aspects such as their legality. WorldStates can be modified through applying actions' effects.
◆ WorldState() [1/2]
| Grail.Planners.WorldState.WorldState |
( |
WorldState |
other | ) |
|
|
inline |
Constructs a new WorldState object that is a copy of the provided WorldState object.
Apart from the domain, it will perform deep copying.
◆ WorldState() [2/2]
Constructs a new WorldState object based on a domain and initial objects.
- Parameters
-
| domain | The planning domain of the space this state belongs to. |
| objects | The initial list of world objects building the state. |
◆ AddObject()
| WorldObject Grail.Planners.WorldState.AddObject |
( |
string |
typeName | ) |
|
|
inline |
Creates a new WorldObject of the provided type and queues it for adding to the WorldState. The addition will be executed at the end of the current planner iteration.
The object will be created with default parameters which you can change later.
- Parameters
-
| typeName | The name of the type of the object to create. |
- Returns
- The created object.
◆ GetObjectByIndex()
| WorldObject Grail.Planners.WorldState.GetObjectByIndex |
( |
int |
index | ) |
|
|
inline |
Retrieves an existing WorldObject stored at the provided index. The index serves as a unique ID.
- Parameters
-
| index | The index of the object to return. |
- Returns
- The retrieved object or
null if there is no object under the provided index.
◆ RemoveObject()
| void Grail.Planners.WorldState.RemoveObject |
( |
int |
objectIndex | ) |
|
|
inline |
Adds the object specified by objectIndex to the set of objects that should be removed at the end of the current planner iteration.
returns>All objects of the given type, including all derived types.
◆ Domain
| Domain Grail.Planners.WorldState.Domain => domain |
Gets the domain of the same planning problem as this state corresponds to.
◆ Objects
| Dictionary<int, WorldObject> Grail.Planners.WorldState.Objects => objects |
Returns a dictionary of WorldObjects: the building blocks of the state.
The documentation for this class was generated from the following file:
- GrailPlanners/source/Planner/WorldState/WorldState.cs