MultiAgentDecisionProcess
Release 0.2.1
|
ProblemFireFighting is a class that represents the firefighting problem as described in refGMAA (DOC-references.h). More...
#include <ProblemFireFighting.h>
Public Member Functions | |
ProblemFireFighting (size_t nrAgents, size_t nrHouses, size_t nrFLs, double costOfMove=0.0, bool forcePositionRepres=false) | |
(default) Constructor | |
![]() | |
virtual DecPOMDPDiscrete * | Clone () 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. | |
RewardModel * | GetRewardModelPtr () const |
Get a pointer to the reward model. | |
RGet * | GetRGet () 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. | |
![]() | |
virtual | ~DecPOMDPDiscreteInterface () |
import the GetReward function from the base class in current scope. | |
![]() | |
virtual | ~POSGDiscreteInterface () |
Destructor.Can't make a virt.destr. pure abstract! | |
![]() | |
virtual | ~MultiAgentDecisionProcessDiscreteInterface () |
Destructor. Can't make a virt.destr. pure abstract! | |
![]() | |
virtual | ~MultiAgentDecisionProcessInterface () |
Destructor. | |
![]() | |
virtual | ~POSGInterface () |
Virtual destructor. | |
![]() | |
virtual | ~DecPOMDPInterface () |
Virtual destructor. | |
![]() | |
void | CreateNewObservationModel () |
Creates a new observation model mapping. | |
void | CreateNewTransitionModel () |
Creates a new transition model mapping. | |
const ObservationModelDiscrete * | GetObservationModelDiscretePtr () 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). | |
OGet * | GetOGet () const |
bool | GetSparse () const |
Are we using sparse transition and observation models? | |
TGet * | GetTGet () const |
const TransitionModelDiscrete * | GetTransitionModelDiscretePtr () 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. | |
![]() | |
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 | |
![]() | |
RewardModel * | _m_p_rModel |
The reward model used by DecPOMDPDiscrete. |
ProblemFireFighting is a class that represents the firefighting problem as described in refGMAA (DOC-references.h).
Definition at line 40 of file ProblemFireFighting.h.
|
private |
Definition at line 43 of file ProblemFireFighting.h.
ProblemFireFighting::ProblemFireFighting | ( | size_t | nrAgents, |
size_t | nrHouses, | ||
size_t | nrFLs, | ||
double | costOfMove = 0.0 , |
||
bool | forcePositionRepres = false |
||
) |
(default) Constructor
Definition at line 45 of file ProblemFireFighting.cpp.
References _m_includePositions, _m_nrFLs_vec, _m_nrJointFirelevels, _m_nrPerStateFeatureVec, _m_nrStateFeatures, MADPComponentDiscreteStates::AddState(), ConstructActions(), MADPComponentDiscreteActions::ConstructJointActions(), MADPComponentDiscreteObservations::ConstructJointObservations(), ConstructObservations(), MultiAgentDecisionProcessDiscrete::CreateNewObservationModel(), DecPOMDPDiscrete::CreateNewRewardModel(), MultiAgentDecisionProcessDiscrete::CreateNewTransitionModel(), DEBUG_CA, DEBUG_CJA, DEBUG_CO, DEBUG_PFF, FillObservationModel(), FillRewardModel(), FillTransitionModel(), MADPComponentDiscreteStates::GetState(), GetStateVector(), DecPOMDP::SetDiscount(), DecPOMDPDiscrete::SetInitialized(), MADPComponentDiscreteStates::SetISD(), MultiAgentDecisionProcess::SetNrAgents(), MultiAgentDecisionProcessDiscrete::SetSparse(), MADPComponentDiscreteStates::SetUniformISD(), NamedDescribedEntity::SoftPrintBrief(), and PrintTools::SoftPrintVector().
|
protected |
Definition at line 512 of file ProblemFireFighting.cpp.
References _m_includePositions, _m_nrHouses, FLAMES, and NOFLAMES.
Referenced by FillObservationModel().
|
protected |
Definition at line 576 of file ProblemFireFighting.cpp.
References _m_nrHouses, and GetStateVector().
Referenced by FillRewardModel().
|
protected |
Definition at line 371 of file ProblemFireFighting.cpp.
References _m_nrFireLevels, and isNeighborBurning().
Referenced by FillTransitionModel().
|
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().
|
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().
|
private |
Fills the observation model with the problem obs. probs.
Definition at line 496 of file ProblemFireFighting.cpp.
References ComputeObservationProb(), MADPComponentDiscreteActions::GetNrJointActions(), MADPComponentDiscreteObservations::GetNrJointObservations(), MADPComponentDiscreteStates::GetNrStates(), GetStateVector(), MADPComponentDiscreteActions::JointToIndividualActionIndices(), MADPComponentDiscreteObservations::JointToIndividualObservationIndices(), prob, and MultiAgentDecisionProcessDiscrete::SetObservationProbability().
Referenced by ProblemFireFighting().
|
private |
Fills the reward model with the problem rewards.
Definition at line 564 of file ProblemFireFighting.cpp.
References ComputeReward(), MADPComponentDiscreteActions::GetNrJointActions(), MADPComponentDiscreteStates::GetNrStates(), and DecPOMDPDiscrete::SetReward().
Referenced by ProblemFireFighting().
|
private |
Fills the transition model with the problem transitions.
Definition at line 311 of file ProblemFireFighting.cpp.
References _m_nrFLs_vec, _m_nrHouses, _m_nrJointFirelevels, _m_nrPerStateFeatureVec, ComputeTransitionProb(), MADPComponentDiscreteActions::GetNrJointActions(), MADPComponentDiscreteStates::GetNrStates(), GetStateVector(), IndexTools::IndividualToJointIndices(), MADPComponentDiscreteActions::JointToIndividualActionIndices(), IndexTools::JointToIndividualIndices(), MultiAgentDecisionProcessDiscrete::SetTransitionProbability(), and PrintTools::SoftPrintVector().
Referenced by ProblemFireFighting().
|
inlineprotected |
Definition at line 75 of file ProblemFireFighting.h.
References _m_nrPerStateFeatureVec, and IndexTools::JointToIndividualIndices().
Referenced by ComputeReward(), FillObservationModel(), FillTransitionModel(), and ProblemFireFighting().
|
staticprotected |
Definition at line 481 of file ProblemFireFighting.cpp.
Referenced by ComputeTransitionProb().
|
private |
Definition at line 296 of file ProblemFireFighting.cpp.
References _m_includePositions, _m_nrHouses, and _m_nrStateFeatures.
|
staticprotected |
Definition at line 219 of file ProblemFireFighting.cpp.
|
staticprotected |
Definition at line 229 of file ProblemFireFighting.cpp.
|
private |
Definition at line 47 of file ProblemFireFighting.h.
Referenced by ComputeObservationProb(), NumberOfContainedStartPositions(), and ProblemFireFighting().
|
private |
Definition at line 44 of file ProblemFireFighting.h.
Referenced by ConstructActions(), and ConstructObservations().
|
private |
Definition at line 46 of file ProblemFireFighting.h.
Referenced by ComputeTransitionProb().
|
private |
Definition at line 55 of file ProblemFireFighting.h.
Referenced by FillTransitionModel(), and ProblemFireFighting().
|
private |
Definition at line 45 of file ProblemFireFighting.h.
Referenced by ComputeObservationProb(), ComputeReward(), ConstructActions(), FillTransitionModel(), and NumberOfContainedStartPositions().
|
private |
Definition at line 53 of file ProblemFireFighting.h.
Referenced by FillTransitionModel(), and ProblemFireFighting().
|
private |
Definition at line 51 of file ProblemFireFighting.h.
Referenced by FillTransitionModel(), GetStateVector(), and ProblemFireFighting().
|
private |
Definition at line 49 of file ProblemFireFighting.h.
Referenced by NumberOfContainedStartPositions(), and ProblemFireFighting().