![]() |
Grail (C++)
1.3.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
|
A class representing planner world state. More...
#include <WorldState.hh>
Public Member Functions | |
WorldState (MemoryPool *memory, const std::shared_ptr< Domain > &domain, const std::vector< WorldObject > &worldObjects) | |
WorldState (const WorldState &other) | |
WorldState (WorldState &&other)=default | |
WorldState & | operator= (const WorldState &other) |
WorldState & | operator= (WorldState &&other)=default |
bool | operator== (const WorldState &other) const |
std::vector< class Action > | GetLegalActions () const |
std::vector< std::vector< unsigned int > > | GenerateParameterLists (const std::vector< std::vector< unsigned int >> &precedingParameterLists, unsigned int searchedTypeIndex) const |
const WorldObject * | GetObjectByIndex (unsigned int index) const |
WorldObject * | GetObjectByIndex (unsigned int index) |
const std::string * | GetDeletedObjectType (unsigned int index) const |
const std::map< unsigned int, WorldObject > & | GetObjectMap () const |
std::shared_ptr< Domain > | GetDomain () const |
WorldObject & | AddObject (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 |
![]() | |
void | MergeParameters (const ParametrizedObject &other) |
MergeParameters - Adds other parameters to own, replacing parameter with other in case of conflict. More... | |
std::size_t | GetParametersSize () const |
bool | Contains (const std::string ¶mName) const |
template<typename ParameterType > | |
void | SetParameter (const std::string ¶mName, const ParameterType ¶mValue) |
template<typename ParameterType > | |
ParameterType | GetParameterValue (const std::string ¶mName) const |
bool | CollectionContains (const std::string &collectionName, unsigned int objectIndex) const |
void | AddCollection (const std::string &collectionName) |
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 | SetSerializeSnapshotFunction (std::function< void(const ParametrizedObject &object, std::map< std::string, std::string > &nameValues)> function) |
SetSerializeSnapshotFunction - Sets a function serializing a snapshot of parameter values to string. More... | |
ParametrizedObject & | operator= (const ParametrizedObject &other) |
ParametrizedObject & | operator= (ParametrizedObject &&other)=default |
Additional Inherited Members | |
![]() | |
ParametrizedObject (MemoryPool *memory) | |
ParametrizedObject (const ParametrizedObject &other) | |
ParametrizedObject (ParametrizedObject &&other)=default | |
![]() | |
std::map< std::string, ObjectParameter * > | parameters {} |
std::map< std::string, std::set< unsigned int > > | indexCollections {} |
MemoryPool * | memory |
A class representing planner world state.
int grail::planner::WorldState::CountObjectsOfType | ( | const std::string & | typeName | ) | const |
std::vector< WorldObject * > grail::planner::WorldState::GetObjectsOfType | ( | const std::string & | typeName | ) |
std::vector< const WorldObject * > grail::planner::WorldState::GetObjectsOfType | ( | const std::string & | typeName | ) | const |
void grail::planner::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