MultiAgentDecisionProcess  Release 0.2.1
ProblemFireFighting Class Reference

ProblemFireFighting is a class that represents the firefighting problem as described in refGMAA (DOC-references.h). More...

#include <ProblemFireFighting.h>

+ Inheritance diagram for ProblemFireFighting:
+ Collaboration diagram for ProblemFireFighting:

Public Member Functions

 ProblemFireFighting (size_t nrAgents, size_t nrHouses, size_t nrFLs, double costOfMove=0.0, bool forcePositionRepres=false)
 (default) Constructor
- Public Member Functions inherited from DecPOMDPDiscrete
virtual DecPOMDPDiscreteClone () const
 Returns a pointer to a copy of this class.
void CreateNewRewardModel ()
 Creates a new reward model.
void CreateNewRewardModelForAgent (Index agentI)
 implementation of POSGDiscreteInterface
 DecPOMDPDiscrete (std::string name="received unspec. by DecPOMDPDiscrete", std::string descr="received unspec. by DecPOMDPDiscrete", std::string pf="received unspec. by DecPOMDPDiscrete")
 Default constructor.
void ExtractMADPDiscrete (MultiAgentDecisionProcessDiscrete *madp)
 Get the MADPDiscrete components from this DecPOMDPDiscrete.
double GetReward (Index sI, Index jaI) const
 Return the reward for state, joint action indices.
double GetReward (State *s, JointAction *ja) const
 implements the DecPOMDPInterface
double GetRewardForAgent (Index agentI, State *s, JointAction *ja) const
 Function that returns the reward for a state and joint action.
double GetRewardForAgent (Index agentI, Index sI, Index jaI) const
 Return the reward for state, joint action indices.
RewardModelGetRewardModelPtr () const
 Get a pointer to the reward model.
RGetGetRGet () const
bool SetInitialized (bool b)
 Sets _m_initialized to b.
void SetReward (Index sI, Index jaI, double r)
 Set the reward for state, joint action indices.
void SetReward (Index sI, Index jaI, Index sucSI, double r)
 Set the reward for state, joint action , suc. state indices.
void SetReward (Index sI, Index jaI, Index sucSI, Index joI, double r)
 Set the reward for state, joint action, suc.state, joint obs indices.
void SetReward (State *s, JointAction *ja, double r)
 implements the DecPOMDPInterface
void SetRewardForAgent (Index agentI, State *s, JointAction *ja, double r)
 Function that sets the reward for an agent, state and joint action.
void SetRewardForAgent (Index agentI, Index sI, Index jaI, double r)
 Set the reward for state, joint action indices.
void SetRewardForAgent (Index agentI, Index sI, Index jaI, Index sucSI, double r)
 Set the reward for state, joint action , suc. state indices.
void SetRewardForAgent (Index agentI, Index sI, Index jaI, Index sucSI, Index joI, double r)
 Set the reward for state, joint action, suc.state, joint obs indices.
std::string SoftPrint () const
 Prints some information on the DecPOMDPDiscrete.
 ~DecPOMDPDiscrete ()
 Destructor.
- Public Member Functions inherited from DecPOMDPDiscreteInterface
virtual ~DecPOMDPDiscreteInterface ()
 import the GetReward function from the base class in current scope.
- Public Member Functions inherited from POSGDiscreteInterface
virtual ~POSGDiscreteInterface ()
 Destructor.Can't make a virt.destr. pure abstract!
- Public Member Functions inherited from MultiAgentDecisionProcessDiscreteInterface
virtual ~MultiAgentDecisionProcessDiscreteInterface ()
 Destructor. Can't make a virt.destr. pure abstract!
- Public Member Functions inherited from MultiAgentDecisionProcessInterface
virtual ~MultiAgentDecisionProcessInterface ()
 Destructor.
- Public Member Functions inherited from POSGInterface
virtual ~POSGInterface ()
 Virtual destructor.
- Public Member Functions inherited from DecPOMDPInterface
virtual ~DecPOMDPInterface ()
 Virtual destructor.
- Public Member Functions inherited from MultiAgentDecisionProcessDiscrete
void CreateNewObservationModel ()
 Creates a new observation model mapping.
void CreateNewTransitionModel ()
 Creates a new transition model mapping.
const ObservationModelDiscreteGetObservationModelDiscretePtr () const
 Returns a pointer to the underlying observation model.
double GetObservationProbability (Index jaI, Index sucSI, Index joI) const
 Return the probability of joint observation joI: P(joI|jaI,sucSI).
OGetGetOGet () const
bool GetSparse () const
 Are we using sparse transition and observation models?
TGetGetTGet () const
const TransitionModelDiscreteGetTransitionModelDiscretePtr () const
 Returns a pointer to the underlying transition model.
double GetTransitionProbability (Index sI, Index jaI, Index sucSI) const
 Return the probability of successor state sucSI: P(sucSI|sI,jaI).
bool Initialize ()
 A function that can be called by other classes in order to request a MultiAgentDecisionProcessDiscrete to (try to) initialize.
 MultiAgentDecisionProcessDiscrete ()
 Default constructor.
 MultiAgentDecisionProcessDiscrete (std::string name="received unspec. by MultiAgentDecisionProcessDiscrete", std::string descr="received unspec.by MultiAgentDecisionProcessDiscrete", std::string pf="received unspec. by MultiAgentDecisionProcessDiscrete")
 Constructor that sets the.
 MultiAgentDecisionProcessDiscrete (int nrAgents, int nrS, std::string name="received unspec. by MultiAgentDecisionProcessDiscrete", std::string descr="received unspec.by MultiAgentDecisionProcessDiscrete", std::string pf="received unspec. by MultiAgentDecisionProcessDiscrete")
 Constructor that sets the.
void Print () const
 Prints some information on the MultiAgentDecisionProcessDiscrete.
Index SampleJointObservation (Index jaI, Index sucI) const
 Sample an observation.
Index SampleSuccessorState (Index sI, Index jaI) const
 Sample a successor state.
void SetObservationModelPtr (ObservationModelDiscrete *ptr)
 Set the obversation model.
void SetObservationProbability (Index jaI, Index sucSI, Index joI, double p)
 Set the probability of joint observation joI: P(joI|jaI,sucSI).
void SetSparse (bool sparse)
 Indicate whether sparse transition and observation models should be used.
void SetTransitionModelPtr (TransitionModelDiscrete *ptr)
 Set the transition model.
void SetTransitionProbability (Index sI, Index jaI, Index sucSI, double p)
 Set the probability of successor state sucSI: P(sucSI|sI,jaI).
 ~MultiAgentDecisionProcessDiscrete ()
 Destructor.
- Public Member Functions inherited from DecPOMDP
 DecPOMDP ()
 Default constructor. sets RewardType to REWARD and discount to 1.0.
double GetDiscount () const
 Returns the discount parameter.
double GetDiscountForAgent (Index agentI) const
 Returns the discount parameter.
reward_t GetRewardType () const
 Returns the reward type.
reward_t GetRewardTypeForAgent (Index agentI) const
 Returns the reward type.
void SetDiscount (double d)
 Sets the discount parameter to d.
void SetDiscountForAgent (Index agentI, double d)
 Functions needed for POSGInterface:
void SetRewardType (reward_t r)
 Sets the reward type to reward_t r.
void SetRewardTypeForAgent (Index agentI, reward_t r)
 Sets the reward type to reward_t r.

Protected Member Functions

double ComputeObservationProb (const std::vector< Index > &ja, const std::vector< Index > &s1, const std::vector< Index > &jo) const
double ComputeReward (Index sI) const
double ComputeTransitionProb (const std::vector< Index > &s1, const std::vector< Index > &ja, const std::vector< Index > &s2) const
std::vector< Index > GetStateVector (Index sI) const

Static Protected Member Functions

static bool isNeighborBurning (const std::vector< Index > &s1, Index hI)
static std::string SoftPrintBriefDescription (size_t nrAgents, size_t nrHouses, size_t nrFLs)
static std::string SoftPrintDescription (size_t nrAgents, size_t nrHouses, size_t nrFLs)

Private Types

enum  observation_t { FLAMES, NOFLAMES }

Private Member Functions

void ConstructActions ()
 Construct all the Actions and actionSets (the vector _m_actionVecs).
void ConstructObservations ()
 Construct all the observations and observation sets.
void FillObservationModel ()
 Fills the observation model with the problem obs. probs.
void FillRewardModel ()
 Fills the reward model with the problem rewards.
void FillTransitionModel ()
 Fills the transition model with the problem transitions.
size_t NumberOfContainedStartPositions (const std::vector< Index > &state) const

Private Attributes

bool _m_includePositions
size_t _m_nrAgents
size_t _m_nrFireLevels
std::vector< size_t > _m_nrFLs_vec
size_t _m_nrHouses
size_t _m_nrJointFirelevels
std::vector< size_t > _m_nrPerStateFeatureVec
size_t _m_nrStateFeatures

Additional Inherited Members

- Protected Attributes inherited from DecPOMDPDiscrete
RewardModel_m_p_rModel
 The reward model used by DecPOMDPDiscrete.

Detailed Description

ProblemFireFighting is a class that represents the firefighting problem as described in refGMAA (DOC-references.h).

Definition at line 40 of file ProblemFireFighting.h.

Member Enumeration Documentation

Enumerator:
FLAMES 
NOFLAMES 

Definition at line 43 of file ProblemFireFighting.h.

Constructor & Destructor Documentation

Member Function Documentation

double ProblemFireFighting::ComputeObservationProb ( const std::vector< Index > &  ja,
const std::vector< Index > &  s1,
const std::vector< Index > &  jo 
) const
protected

Definition at line 512 of file ProblemFireFighting.cpp.

References _m_includePositions, _m_nrHouses, FLAMES, and NOFLAMES.

Referenced by FillObservationModel().

double ProblemFireFighting::ComputeReward ( Index  sI) const
protected

Definition at line 576 of file ProblemFireFighting.cpp.

References _m_nrHouses, and GetStateVector().

Referenced by FillRewardModel().

double ProblemFireFighting::ComputeTransitionProb ( const std::vector< Index > &  s1,
const std::vector< Index > &  ja,
const std::vector< Index > &  s2 
) const
protected

Definition at line 371 of file ProblemFireFighting.cpp.

References _m_nrFireLevels, and isNeighborBurning().

Referenced by FillTransitionModel().

void ProblemFireFighting::ConstructActions ( )
private

Construct all the Actions and actionSets (the vector _m_actionVecs).

Definition at line 240 of file ProblemFireFighting.cpp.

References MADPComponentDiscreteActions::_m_actionVecs, MADPComponentDiscreteActions::_m_nrActions, _m_nrAgents, and _m_nrHouses.

Referenced by ProblemFireFighting().

void ProblemFireFighting::ConstructObservations ( )
private

Construct all the observations and observation sets.

add observations:

Definition at line 264 of file ProblemFireFighting.cpp.

References _m_nrAgents, MADPComponentDiscreteObservations::_m_nrObservations, MADPComponentDiscreteObservations::_m_observationVecs, FLAMES, and NOFLAMES.

Referenced by ProblemFireFighting().

void ProblemFireFighting::FillRewardModel ( )
private
std::vector< Index> ProblemFireFighting::GetStateVector ( Index  sI) const
inlineprotected
bool ProblemFireFighting::isNeighborBurning ( const std::vector< Index > &  s1,
Index  hI 
)
staticprotected

Definition at line 481 of file ProblemFireFighting.cpp.

Referenced by ComputeTransitionProb().

size_t ProblemFireFighting::NumberOfContainedStartPositions ( const std::vector< Index > &  state) const
private

Definition at line 296 of file ProblemFireFighting.cpp.

References _m_includePositions, _m_nrHouses, and _m_nrStateFeatures.

std::string ProblemFireFighting::SoftPrintBriefDescription ( size_t  nrAgents,
size_t  nrHouses,
size_t  nrFLs 
)
staticprotected

Definition at line 219 of file ProblemFireFighting.cpp.

std::string ProblemFireFighting::SoftPrintDescription ( size_t  nrAgents,
size_t  nrHouses,
size_t  nrFLs 
)
staticprotected

Definition at line 229 of file ProblemFireFighting.cpp.

Member Data Documentation

bool ProblemFireFighting::_m_includePositions
private
size_t ProblemFireFighting::_m_nrAgents
private

Definition at line 44 of file ProblemFireFighting.h.

Referenced by ConstructActions(), and ConstructObservations().

size_t ProblemFireFighting::_m_nrFireLevels
private

Definition at line 46 of file ProblemFireFighting.h.

Referenced by ComputeTransitionProb().

std::vector<size_t> ProblemFireFighting::_m_nrFLs_vec
private

Definition at line 55 of file ProblemFireFighting.h.

Referenced by FillTransitionModel(), and ProblemFireFighting().

size_t ProblemFireFighting::_m_nrHouses
private
size_t ProblemFireFighting::_m_nrJointFirelevels
private

Definition at line 53 of file ProblemFireFighting.h.

Referenced by FillTransitionModel(), and ProblemFireFighting().

std::vector<size_t> ProblemFireFighting::_m_nrPerStateFeatureVec
private

Definition at line 51 of file ProblemFireFighting.h.

Referenced by FillTransitionModel(), GetStateVector(), and ProblemFireFighting().

size_t ProblemFireFighting::_m_nrStateFeatures
private

Definition at line 49 of file ProblemFireFighting.h.

Referenced by NumberOfContainedStartPositions(), and ProblemFireFighting().


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