MultiAgentDecisionProcess  Release 0.2.1
PlanningUnit Class Reference

PlanningUnit represents a planning unit, i.e., a planning algorithm. More...

#include <PlanningUnit.h>

+ Inheritance diagram for PlanningUnit:
+ Collaboration diagram for PlanningUnit:

Public Member Functions

size_t GetHorizon () const
 Returns the planning horizon.
virtual JointPolicyGetJointPolicy ()=0
 Returns a pointer to the computed joint policy.
Index GetNextAgentIndex ()
 Maintains a agent index and returns the next one on calling */.
size_t GetNrAgents () const
 Return the number of agents.
const
MultiAgentDecisionProcessInterface
GetProblem () const
 Get the problem pointer.
int GetSeed () const
 Returns the random seed stored.
void InitSeed () const
 Initializes the random number generator (srand) to the stored seed.
virtual void Plan ()=0
 The function that performs the actual planning.
 PlanningUnit (size_t horizon, MultiAgentDecisionProcessInterface *p)
 (default) Constructor
virtual void SetHorizon (size_t horizon)
 Updates the horizon of the planning problem.
void SetProblem (MultiAgentDecisionProcessInterface *p)
 Updates the problem pointer.
void SetSeed (int s)
 Stores the random seed and calls InitSeed().
virtual ~PlanningUnit ()
 Destructor.

Private Attributes

Index _m_agentI
 Used by GetNextAgentIndex().
size_t _m_horizon
 The planning horizon: MAXHORIZON for infinite horizon. */.
MultiAgentDecisionProcessInterface_m_problem
 Pointer to the problem.
int _m_seed
 The random seed.

Detailed Description

PlanningUnit represents a planning unit, i.e., a planning algorithm.

This is a very general class, that only manages the planning horizon and can initialize the random number generator (srand).

Definition at line 48 of file PlanningUnit.h.

Constructor & Destructor Documentation

PlanningUnit::PlanningUnit ( size_t  horizon,
MultiAgentDecisionProcessInterface p 
)
inline

(default) Constructor

Constructor which sets the horizon and the problem.

Definition at line 70 of file PlanningUnit.h.

virtual PlanningUnit::~PlanningUnit ( )
inlinevirtual

Destructor.

Definition at line 79 of file PlanningUnit.h.

Member Function Documentation

virtual JointPolicy* PlanningUnit::GetJointPolicy ( )
pure virtual
Index PlanningUnit::GetNextAgentIndex ( )
inline

Maintains a agent index and returns the next one on calling */.

Definition at line 106 of file PlanningUnit.h.

References _m_agentI, and GetNrAgents().

Referenced by JESPExhaustivePlanner::Plan(), and JESPDynamicProgrammingPlanner::Plan().

size_t PlanningUnit::GetNrAgents ( ) const
inline

Return the number of agents.

Reimplemented in PlanningUnitMADPDiscrete.

Definition at line 103 of file PlanningUnit.h.

References _m_problem, and MultiAgentDecisionProcessInterface::GetNrAgents().

Referenced by GetNextAgentIndex(), and PlanningUnitMADPDiscrete::GetNrAgents().

const MultiAgentDecisionProcessInterface* PlanningUnit::GetProblem ( ) const
inline

Get the problem pointer.

Reimplemented in PlanningUnitMADPDiscrete.

Definition at line 113 of file PlanningUnit.h.

References _m_problem.

Referenced by directories::MADPCreateResultsDir(), directories::MADPGetResultsDir(), and directories::MADPGetResultsFilename().

int PlanningUnit::GetSeed ( ) const
inline

Returns the random seed stored.

Definition at line 100 of file PlanningUnit.h.

References _m_seed.

void PlanningUnit::InitSeed ( ) const
inline

Initializes the random number generator (srand) to the stored seed.

Definition at line 94 of file PlanningUnit.h.

References _m_seed.

Referenced by SetSeed().

virtual void PlanningUnit::Plan ( )
pure virtual
virtual void PlanningUnit::SetHorizon ( size_t  horizon)
inlinevirtual

Updates the horizon of the planning problem.

Reimplemented in PlanningUnitMADPDiscrete.

Definition at line 91 of file PlanningUnit.h.

References _m_horizon.

void PlanningUnit::SetProblem ( MultiAgentDecisionProcessInterface p)
inline

Updates the problem pointer.

Definition at line 88 of file PlanningUnit.h.

References _m_problem.

void PlanningUnit::SetSeed ( int  s)
inline

Stores the random seed and calls InitSeed().

Definition at line 85 of file PlanningUnit.h.

References _m_seed, and InitSeed().

Member Data Documentation

Index PlanningUnit::_m_agentI
private

Used by GetNextAgentIndex().

Definition at line 56 of file PlanningUnit.h.

Referenced by GetNextAgentIndex().

size_t PlanningUnit::_m_horizon
private

The planning horizon: MAXHORIZON for infinite horizon. */.

Definition at line 59 of file PlanningUnit.h.

Referenced by GetHorizon(), and SetHorizon().

MultiAgentDecisionProcessInterface* PlanningUnit::_m_problem
private

Pointer to the problem.

Definition at line 53 of file PlanningUnit.h.

Referenced by GetNrAgents(), GetProblem(), and SetProblem().

int PlanningUnit::_m_seed
private

The random seed.

Definition at line 61 of file PlanningUnit.h.

Referenced by GetSeed(), InitSeed(), and SetSeed().


The documentation for this class was generated from the following file: