Class CoverageWorld

Inheritance Relationships

Base Type

  • public despot::World

Class Documentation

class CoverageWorld : public despot::World

Class for coverage worlds represented using IMac.

Attributes: As in superclass, plus:

  • _initPos: Initial robot position

  • _initTime: The initial time the robot starts coverage

  • _timeBound: The time bound on coverage planning

  • _exec: An IMacExecutor which we sample through

Public Functions

inline CoverageWorld(const GridCell &initPos, const int &initTime, const int &timeBound, const std::vector<GridCell> &fov, std::shared_ptr<IMacExecutor> exec)

Initialises attributes.

Parameters:
  • initPos – The initial position of the robot

  • initTime – The time the robot starts coverage

  • timeBound – The time bound on coverage planning

  • fov – The robot’s FOV as a list of GridCells relative to its position

  • exec – The IMac executor instance we are sampling with

inline ~CoverageWorld()

Deallocates state_ (attribute in superclass, can’t use smart pointers :()

bool Connect()

No ‘connection’ needed here, just returns true.

Returns:

Always true

despot::State *Initialize()

Resets the IMacExecutor and returns the initial coverage state.

Returns:

The initial CoverageState

despot::State *GetCurrentState() const

Returns the current CoverageState of the system.

Returns:

The current CoverageState

void PrintState(const despot::State &s, ostream &out) const

Print a state.

Parameters:
  • s – The state to print

  • out – The stream to write to

bool ExecuteAction(despot::ACT_TYPE action, despot::OBS_TYPE &obs)

Execute action, update state, and make observation.

Parameters:
  • action – Action to be executed in the real-world system

  • obs – Observation sent back from the real-world system

Returns:

Is the current state a terminal state?