(C++)  1.0.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::planning::WorldState Class Reference

A class representing planner world state. More...

#include <WorldState.hh>

Inheritance diagram for grail::planning::WorldState:
Collaboration diagram for grail::planning::WorldState:

Public Member Functions

 WorldState (MemoryPool &memory)
 
 WorldState (const std::shared_ptr< Domain > &domain, const std::vector< WorldObject > &worldObjects, MemoryPool &memory)
 
 WorldState (const WorldState &other)
 
 WorldState (WorldState &&other)=default
 
WorldStateoperator= (const WorldState &other)
 
WorldStateoperator= (WorldState &&other)=default
 
bool operator== (const WorldState &other) const
 
std::vector< class ActionGetLegalActions () const
 
std::vector< std::vector< unsigned int > > GenerateParameterLists (const std::vector< std::vector< unsigned int >> &precedingParameterLists, unsigned int searchedTypeIndex) const
 
const WorldObjectGetObjectByIndex (unsigned int index) const
 
WorldObjectGetObjectByIndex (unsigned int index)
 
const std::map< unsigned int, WorldObject > & GetObjectMap () const
 
std::shared_ptr< DomainGetDomain () const
 
WorldObjectAddObject (const std::string &typeName)
 
void RemoveObject (unsigned int objectIndex)
 
void AddQueuedObjects ()
 
void RemoveQueuedObjects ()
 
std::vector< const WorldObject * > GetObjectsOfType (const std::string &typeName) const
 
std::vector< WorldObject * > GetObjectsOfType (const std::string &typeName)
 
int CountObjectsOfType (const std::string &typeName) const
 
- Public Member Functions inherited from grail::planning::ParametrizedObject
void MergeParameters (const ParametrizedObject &other)
 
std::size_t GetParametersSize () const
 
bool Contains (const std::string &paramName) const
 
template<typename ParameterType >
void SetParameter (const std::string &paramName, const ParameterType &paramValue)
 
template<typename ParameterType >
ParameterType GetParameterValue (const std::string &paramName) const
 
bool CollectionContains (const std::string &collectionName, unsigned int objectIndex) const
 
void AddCollection (const std::string &collectionName)
 Creates a new id collection under the given name.
 
std::set< unsigned int > * GetCollection (const std::string &name)
 
const std::set< unsigned int > * GetCollection (const std::string &name) const
 
bool HasEqualParams (const ParametrizedObject &other) const
 
void SerializeForGUI (std::map< std::string, std::string > &nameValues) const
 
void SetSerializeForGUIFunction (std::function< void(const ParametrizedObject &object, std::map< std::string, std::string > &nameValues)> function)
 
ParametrizedObjectoperator= (const ParametrizedObject &other)
 
ParametrizedObjectoperator= (ParametrizedObject &&other)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from grail::planning::ParametrizedObject
 ParametrizedObject (MemoryPool &memory)
 
 ParametrizedObject (const ParametrizedObject &other)
 
 ParametrizedObject (ParametrizedObject &&other)=default
 
- Protected Attributes inherited from grail::planning::ParametrizedObject
std::map< std::string, ObjectParameter * > parameters {}
 
std::map< std::string, std::set< unsigned int > > indexCollections {}
 
MemoryPoolmemory
 

Detailed Description

A class representing planner world state.

Member Function Documentation

◆ CountObjectsOfType()

int grail::planning::WorldState::CountObjectsOfType ( const std::string &  typeName) const
Returns
The number of objects of given type, including all derived types

◆ GetObjectsOfType() [1/2]

std::vector< WorldObject * > grail::planning::WorldState::GetObjectsOfType ( const std::string &  typeName)
Returns
All objects of a given type, including all derived types

◆ GetObjectsOfType() [2/2]

std::vector< const WorldObject * > grail::planning::WorldState::GetObjectsOfType ( const std::string &  typeName) const
Returns
All objects of a given type, including all derived types

◆ RemoveObject()

void grail::planning::WorldState::RemoveObject ( unsigned int  objectIndex)

Adds the object specified by objectIndex to a set of objects that should be removed at the end of the current planner iteration


The documentation for this class was generated from the following files: