StateStorage.h
147 virtual StateSamplerAllocator getStateSamplerAllocatorRange(std::size_t from, std::size_t to) const;
boost::function< StateSamplerPtr(const StateSpace *)> StateSamplerAllocator
Definition of a function that can allocate a state sampler.
Definition: StateSampler.h:184
const State * getState(unsigned int index) const
Get a particular state.
Definition: StateStorage.h:117
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:207
A boost 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:246
StateStorage(const StateSpacePtr &space)
The state space to store states for is specified as argument.
Definition: StateStorage.cpp:73
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:237
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:261
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:134
StateSpacePtr space_
State space that corresponds to maintained states.
Definition: StateStorage.h:198
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:233
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.h:226
const std::vector< const State * > & getStates() const
Get the stored states.
Definition: StateStorage.h:104
M & getMetadata(unsigned int index)
Get write access to the metadata of a state at a particular index.
Definition: StateStorage.h:253
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:151
virtual void loadMetadata(const Header &, 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.h:261
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:242
virtual void storeMetadata(const Header &, 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.h:266
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:277
virtual void clear()
Clear the stored states. This frees all the memory.
Definition: StateStorage.cpp:226
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:200
std::vector< int > signature
Signature of state space that allocated the saved states (see ompl::base::StateSpace::computeSignatur...
Definition: StateStorage.h:164
State storage that allows storing state metadata as well.
Definition: StateStorage.h:210
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:252
Information stored at the beginning of the archive.
Definition: StateStorage.h:155
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:182
void load(const char *filename)
Load a set of states from a specified file.
Definition: StateStorage.cpp:82
bool hasMetadata_
Flag indicating whether there is metadata associated to the states in this storage.
Definition: StateStorage.h:204
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:196
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:247
void sort(const boost::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:232
virtual void clear()
Clear the stored states. This frees all the memory.
Definition: StateStorage.h:239
State * getState(unsigned int index)
Get a particular state for non-const access.
Definition: StateStorage.h:110
void serialize(Archive &ar, const unsigned int)
boost::serialization routine
Definition: StateStorage.h:168
const StateSpacePtr & getStateSpace() const
Get the state space this class maintains states for.
Definition: StateStorage.h:70
StateStorageWithMetadata(const StateSpacePtr &space)
The state space to store states for is specified as argument.
Definition: StateStorage.h:218
bool hasMetadata() const
Return a flag that indicates whether there is metadata associated to the states in this storage...
Definition: StateStorage.h:124