Class CoveragePOMDP

Inheritance Relationships

Base Type

  • public despot::DSPOMDP

Class Documentation

class CoveragePOMDP : public despot::DSPOMDP

POMDP model for coverage planning problems under spatio temporal uncertainty.

Members:

  • _memory_pool: A memory pool for allocating CoverageStates

  • _fov: A vector of GridCells relative to the robot’s position which capture its FOV.

  • _imac: The IMac instance used for planning

  • _beliefSampler: The IMac belief sampler used for the simulator

  • _timeBound: The planning horizon in timesteps

Public Functions

inline CoveragePOMDP(const std::vector<GridCell> &fov, std::shared_ptr<IMac> imac, int timeBound)

Constructor initialises members.

Parameters:
  • fov – The robot’s field of view as a vector of grid cells relative to the robot’s position

  • imac – The IMac instance used for planning

  • timeBound – The planning horizon in timesteps

bool Step(despot::State &state, double random_num, despot::ACT_TYPE action, double &reward, despot::OBS_TYPE &obs) const

The deterministic simulative model for the POMDP. Avoids enumerating the whole POMDP, which is huge.

Parameters:
  • state – The current state of the system (assumed known). Should be updated with the successor state

  • random_num – A single random number which should dictate the successor state and observation

  • action – The action to be executed

  • reward – The reward value. Should be updated with current step’s reward

  • obs – The current observation. Should be updated with current step’s observation

Returns:

True if the successor state is a terminal state

int NumActions() const

Returns the number of actions. Makes the assumption that all actions are enabled at each state (not ideal).

TODO: In the future, see if I can extend this to be dependent on the state of belief

Returns:

The number of executable actions

double ObsProb(despot::OBS_TYPE obs, const despot::State &state, despot::ACT_TYPE action) const

Return the probability of observing obs given we took action and reached state.

Parameters:
  • obs – The latest observation

  • state – The state we ended up at after executing action

  • action – The action executed

Returns:

The probability of making the observation

despot::Belief *InitialBelief(const despot::State *start, std::string type = "DEFAULT") const

Return the initial belief, which corresponds to the initial IMac belief.

Parameters:
  • start – A (partial) initial state, e.g. the robot’s initial position

  • type – A parameter which allows to specify the type of the belief

Returns:

The initial belief

double GetMaxReward() const

Returns the maximal immediate reward.

Returns:

The maximum immediate reward

despot::ValuedAction GetBestAction() const

Returns (a, v), where a is an action with largest minimum reward when it is executed, and v is its minimum reward, that is, a = \max_{a’} \min_{s} R(a’, s), and v = \min_{s} R(a, s) (copied from superclass as I can’t explain it better).

Returns:

The action with the largest minimum reward

despot::ScenarioUpperBound *CreateScenarioUpperBound(std::string name = "DEFAULT", std::string particleBoundName = "DEFAULT") const

Override to allow for MaxCellsUpperBound.

Parameters:
  • name – Name of the upper bound

  • particleBoundName – Name of the base ParticleUpperBound

Returns:

The upper bound

despot::ParticleLowerBound *CreateParticleLowerBound(std::string name = "DEFAULT") const

Override to allow for ZeroParticleLowerBound.

Parameters:

name – Name of the particle lower bound

Returns:

The particle lower bound

despot::ScenarioLowerBound *CreateScenarioLowerBound(std::string bound_name = "DEFAULT", std::string particleBoundName = "DEFAULT") const

Override to allow for GreedyCoverageDefaultPolicy.

Parameters:
  • name – Name of the lower bound

  • particleBoundName – Name of the ParticleLowerBound to be used

void PrintState(const despot::State &state, std::ostream &out = std::cout) const

Prints a state.

Parameters:
  • state – The state to print

  • out – The stream to write the state to

void PrintObs(const despot::State &state, despot::OBS_TYPE obs, std::ostream &out = std::cout) const

Prints an observation.

Parameters:
  • state – The current state

  • obs – The latest observation

  • out – The stream to write the observation to

void PrintAction(despot::ACT_TYPE action, std::ostream &out = std::cout) const

Prints an action.

Parameters:
  • action – The action to print

  • out – The stream to write the action to

void PrintBelief(const despot::Belief &belief, std::ostream &out = std::cout) const

Prints a belief.

Parameters:
  • belief – The belief to print

  • out – The stream to write the belief to

despot::State *Allocate(int state_id = -1, double weight = 0) const

Allocate a state using the memory pool.

Parameters:
  • state_id – The state’s ID

  • weight – The weight of the allocated state

Returns:

A pointer to the newly allocated state

despot::State *Copy(const despot::State *state) const

Copy a state.

Parameters:

state – The state to copy

Returns:

A pointer to the state copy

void Free(despot::State *state) const

Deallocate a state in the memory pool.

Parameters:

state – The state to deallocate

int NumActiveParticles() const

Returns the number of allocated particles (sampled states). All examples set this to the number of particles in the memory pool.

Returns:

The number of active particles