StateStorage.h
151 virtual StateSamplerAllocator getStateSamplerAllocatorRange(std::size_t from, std::size_t to) const;
const State * getState(unsigned int index) const
Get a particular state.
Definition: StateStorage.h:116
Manage loading and storing for a set of states of a specified state space.
Definition: StateStorage.h:61
virtual void generateSamples(unsigned int count)
Generate count states uniformly at random and store them in this structure.
Definition: StateStorage.cpp:205
A shared pointer wrapper for ompl::base::StateSpace.
const M & getMetadata(unsigned int index) const
Get const access to the metadata of a state at a particular index.
Definition: StateStorage.h:250
StateSamplerAllocator getStateSamplerAllocator() const
Get a sampler allocator to a sampler that can be specified for a StateSpace, such that all sampled st...
Definition: StateStorage.cpp:235
void loadMetadata(const Header &, boost::archive::binary_iarchive &ia) override
Load the state metadata from a binary archive ia, given the loaded header is h. No metadata is actual...
Definition: StateStorage.h:264
virtual void print(std::ostream &out=std::cout) const
Output the set of states to a specified stream, in a human readable fashion.
Definition: StateStorage.cpp:263
virtual void loadStates(const Header &h, boost::archive::binary_iarchive &ia)
Load the states from a binary archive ia, given the loaded header is h.
Definition: StateStorage.cpp:133
StateSpacePtr space_
State space that corresponds to maintained states.
Definition: StateStorage.h:202
virtual void addState(const State *state, const M &metadata)
Add a state to the set of states maintained by this storage structure. The state is copied to interna...
Definition: StateStorage.h:237
M & getMetadata(unsigned int index)
Get write access to the metadata of a state at a particular index.
Definition: StateStorage.h:257
void sort(const std::function< bool(const State *, const State *)> &op)
Sort the states according to the less-equal operator op. Metadata is NOT sorted; if metadata was adde...
Definition: StateStorage.cpp:230
StateStorage(StateSpacePtr space)
The state space to store states for is specified as argument.
Definition: StateStorage.cpp:74
virtual void loadMetadata(const Header &h, boost::archive::binary_iarchive &ia)
Load the state metadata from a binary archive ia, given the loaded header is h. No metadata is actual...
Definition: StateStorage.cpp:150
StateSamplerAllocator getStateSamplerAllocatorRangeUntil(std::size_t until) const
Get a sampler allocator to a sampler that can be specified for a StateSpace, such that all sampled st...
Definition: StateStorage.cpp:240
StateStorageWithMetadata< std::vector< std::size_t > > GraphStateStorage
Storage of states where the metadata is a vector of indices. This is is typically used to store a gra...
Definition: StateStorage.h:282
virtual void clear()
Clear the stored states. This frees all the memory.
Definition: StateStorage.cpp:224
virtual void addState(const State *state)
Add a state to the set of states maintained by this storage structure. The state is copied to interna...
Definition: StateStorage.cpp:198
const std::vector< const State * > & getStates() const
Get the stored states.
Definition: StateStorage.h:103
std::vector< int > signature
Signature of state space that allocated the saved states (see ompl::base::StateSpace::computeSignatur...
Definition: StateStorage.h:168
State storage that allows storing state metadata as well.
Definition: StateStorage.h:214
void clear() override
Clear the stored states. This frees all the memory.
Definition: StateStorage.h:243
virtual StateSamplerAllocator getStateSamplerAllocatorRange(std::size_t from, std::size_t to) const
Get a sampler allocator to a sampler that can be specified for a StateSpace, such that all sampled st...
Definition: StateStorage.cpp:250
void addState(const State *state) override
Add a state to the set of states maintained by this storage structure. The state is copied to interna...
Definition: StateStorage.h:229
void storeMetadata(const Header &, boost::archive::binary_oarchive &oa) override
Save the state metadata to a binary archive oa, given the stored header is h. No metadata is actually...
Definition: StateStorage.h:271
Information stored at the beginning of the archive.
Definition: StateStorage.h:158
virtual void storeStates(const Header &h, boost::archive::binary_oarchive &oa)
Store the states to a binary archive oa, given the stored header is h.
Definition: StateStorage.cpp:180
void load(const char *filename)
Load a set of states from a specified file.
Definition: StateStorage.cpp:83
bool hasMetadata_
Flag indicating whether there is metadata associated to the states in this storage.
Definition: StateStorage.h:208
virtual void storeMetadata(const Header &h, boost::archive::binary_oarchive &oa)
Save the state metadata to a binary archive oa, given the stored header is h. No metadata is actually...
Definition: StateStorage.cpp:194
StateSamplerAllocator getStateSamplerAllocatorRangeAfter(std::size_t after) const
Get a sampler allocator to a sampler that can be specified for a StateSpace, such that all sampled st...
Definition: StateStorage.cpp:245
std::function< StateSamplerPtr(const StateSpace *)> StateSamplerAllocator
Definition of a function that can allocate a state sampler.
Definition: StateSampler.h:191
State * getState(unsigned int index)
Get a particular state for non-const access.
Definition: StateStorage.h:109
void serialize(Archive &ar, const unsigned int)
boost::serialization routine
Definition: StateStorage.h:172
const StateSpacePtr & getStateSpace() const
Get the state space this class maintains states for.
Definition: StateStorage.h:69
StateStorageWithMetadata(const StateSpacePtr &space)
The state space to store states for is specified as argument.
Definition: StateStorage.h:221
bool hasMetadata() const
Return a flag that indicates whether there is metadata associated to the states in this storage...
Definition: StateStorage.h:124