StateStorage.cpp
48 static ompl::base::StateSamplerPtr allocPrecomputedStateSampler(const ompl::base::StateSpace *space,
58 ss << "Cannot allocate state sampler for a state space whose signature does not match that of the stored states. ";
67 return ompl::base::StateSamplerPtr(new ompl::base::PrecomputedStateSampler(space, *states, minIndex, maxIndex));
73 ompl::base::StateStorage::StateStorage(const StateSpacePtr &space) : space_(space), hasMetadata_(false)
151 void ompl::base::StateStorage::loadMetadata(const Header& /*h*/, boost::archive::binary_iarchive& /*ia*/)
182 void ompl::base::StateStorage::storeStates(const Header& /*h*/, boost::archive::binary_oarchive &oa)
196 void ompl::base::StateStorage::storeMetadata(const Header& /*h*/, boost::archive::binary_oarchive& /*oa*/)
232 void ompl::base::StateStorage::sort(const boost::function<bool(const State*, const State*)> &op)
242 ompl::base::StateSamplerAllocator ompl::base::StateStorage::getStateSamplerAllocatorRangeUntil(std::size_t until) const
247 ompl::base::StateSamplerAllocator ompl::base::StateStorage::getStateSamplerAllocatorRangeAfter(std::size_t after) const
252 ompl::base::StateSamplerAllocator ompl::base::StateStorage::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
virtual void generateSamples(unsigned int count)
Generate count states uniformly at random and store them in this structure.
Definition: StateStorage.cpp:207
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
A boost shared pointer wrapper for ompl::base::StateSpace.
A boost shared pointer wrapper for ompl::base::StateSampler.
StateStorage(const StateSpacePtr &space)
The state space to store states for is specified as argument.
Definition: StateStorage.cpp:73
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
void computeSignature(std::vector< int > &signature) const
Compute an array of ints that uniquely identifies the structure of the state space. The first element of the signature is the number of integers that follow.
Definition: StateSpace.cpp:220
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
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
State space sampler for discrete states.
Definition: PrecomputedStateSampler.h:46
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 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
Representation of a space in which planning can be performed. Topology specific sampling, interpolation and distance are defined.
Definition: StateSpace.h:73
std::vector< int > signature
Signature of state space that allocated the saved states (see ompl::base::StateSpace::computeSignatur...
Definition: StateStorage.h:164
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
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
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 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
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