Class sdm::JointDeterministicDecisionRule

Class List > sdm > JointDeterministicDecisionRule

This class provide a way to manipulate a function that maps joint histories to joint actions.

  • #include <joint_det_decision_rule.hpp>

Inherits the following classes: sdm::Joint, sdm::DeterministicDecisionRule

Public Types

Type Name
typedef typename DeterministicDecisionRule::input_type input_type
typedef typename DeterministicDecisionRule::output_type output_type

Public Types inherited from sdm::Joint

See sdm::Joint

Type Name
typedef T value_type

Public Types inherited from sdm::Function

See sdm::Function

Type Name
typedef TInput input_type
typedef TOutput output_type

Public Types inherited from sdm::Function

See sdm::Function

Type Name
typedef TInput input_type
typedef TOutput output_type

Public Functions

Type Name
JointDeterministicDecisionRule ()
JointDeterministicDecisionRule (const Joint< std::shared_ptr< DeterministicDecisionRule >> & individual_decision_rules)
JointDeterministicDecisionRule (std::vector< std::vector< std::shared_ptr< Item >>> acc_states, std::vector< std::vector< std::shared_ptr< Item >>> actions)
JointDeterministicDecisionRule (const std::vector< std::shared_ptr< Item >> &, const std::vector< std::shared_ptr< Item >> & list_indiv_dr)
virtual std::shared_ptr< Action > act (const std::shared_ptr< State > & state) const
Get the action deducted from a given state.
virtual bool elementExist (const std::shared_ptr< State > &)
double getProbability (const Joint< std::shared_ptr< State >> & state, const Joint< std::shared_ptr< Action >> & action) const
Get the probability of joint action 'action' in joint state 'state'.
virtual double getProbability (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action) const
Get the probability of selecting action a in state s. This should return 0 if the action that corresponds to the state is a.
double getProbability (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, const number & agent_id) const
Get the probability of action 'action' in state 'state' for agent id.
void setProbability (const Joint< std::shared_ptr< State >> & state, const Joint< std::shared_ptr< Action >> & action, double proba=0)
Sets the probability of selecting action a when observing state s.
virtual void setProbability (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, double proba=1)
Set the probability of selecting action a in state s.
virtual std::string str () const

Public Functions inherited from sdm::Joint

See sdm::Joint

Type Name
Joint ()
Joint (const std::vector< T > & joint_item)
Joint (const std::vector< number > &, const std::vector< T > & joint_item)
Joint (std::initializer_list< T > list_values)
const T & get (const number &) const
Get the element for agent i.
number getNumAgents () const
Get the number of agents (i.e. the size of the joint element)
virtual T operator() (const number &)
Get the element for agent i.
void serialize (Archive & archive, const unsigned int)
std::string str () const
std::shared_ptr< Joint< std::shared_ptr< TOutput > > > toJoint ()
virtual ~Joint ()

Public Functions inherited from sdm::Function

See sdm::Function

Type Name
virtual output_type operator() (const input_type &) = 0
virtual ~Function ()

Public Functions inherited from sdm::DeterministicDecisionRule

See sdm::DeterministicDecisionRule

Type Name
DeterministicDecisionRule ()
DeterministicDecisionRule (const DeterministicDecisionRule & copy)
DeterministicDecisionRule (const std::vector< std::shared_ptr< Item >> & acc_states, const std::vector< std::shared_ptr< Item >> & n_actions)
virtual std::shared_ptr< Action > act (const std::shared_ptr< State > & state) const
Get the action deducted from a given state.
virtual bool elementExist (const std::shared_ptr< State > &)
std::map< std::shared_ptr< State >, std::shared_ptr< Action > > getMap () const
virtual double getProbability (const std::shared_ptr< State > & s, const std::shared_ptr< Action > & a) const
Get the probability of selecting action a in state s. This should return 0 if the action that corresponds to the state is a.
virtual void setProbability (const std::shared_ptr< State > & s, const std::shared_ptr< Action > & a, double proba=1)
Set the probability of selecting action a in state s.
virtual std::string str () const

Public Functions inherited from sdm::DecisionRule

See sdm::DecisionRule

Type Name
virtual std::shared_ptr< Action > act (const std::shared_ptr< State > & state) const = 0
Get the action deducted from a given state.
virtual bool elementExist (const std::shared_ptr< State > &) = 0
virtual double getProbability (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action) const = 0
Get the probability of action 'action' in state 'state'.
virtual TypeAction getTypeAction () const
std::shared_ptr< Action > operator() (const std::shared_ptr< State > & s)
virtual void setProbability (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, double proba) = 0
Sets the probability of selecting action a when observing state s.
virtual std::string str () const = 0

Public Functions inherited from sdm::Function

See sdm::Function

Type Name
virtual output_type operator() (const input_type &) = 0
virtual ~Function ()

Protected Attributes inherited from sdm::DeterministicDecisionRule

See sdm::DeterministicDecisionRule

Type Name
std::map< std::shared_ptr< State >, std::shared_ptr< Action > > map_state_to_action_

Public Types Documentation

typedef input_type

using sdm::JointDeterministicDecisionRule::input_type =  typename DeterministicDecisionRule::input_type;

typedef output_type

using sdm::JointDeterministicDecisionRule::output_type =  typename DeterministicDecisionRule::output_type;

Public Functions Documentation

function JointDeterministicDecisionRule [1/4]

sdm::JointDeterministicDecisionRule::JointDeterministicDecisionRule () 

function JointDeterministicDecisionRule [2/4]

sdm::JointDeterministicDecisionRule::JointDeterministicDecisionRule (
    const Joint < std::shared_ptr< DeterministicDecisionRule >> & individual_decision_rules
) 

function JointDeterministicDecisionRule [3/4]

sdm::JointDeterministicDecisionRule::JointDeterministicDecisionRule (
    std::vector< std::vector< std::shared_ptr< Item >>> acc_states,
    std::vector< std::vector< std::shared_ptr< Item >>> actions
) 

function JointDeterministicDecisionRule [4/4]

sdm::JointDeterministicDecisionRule::JointDeterministicDecisionRule (
    const std::vector< std::shared_ptr< Item >> &,
    const std::vector< std::shared_ptr< Item >> & list_indiv_dr
) 

function act

virtual std::shared_ptr< Action > sdm::JointDeterministicDecisionRule::act (
    const std::shared_ptr< State > & state
) const

Parameters:

  • state the generic state

Returns:

the corresponding action

Implements sdm::DeterministicDecisionRule::act

function elementExist

virtual bool sdm::JointDeterministicDecisionRule::elementExist (
    const std::shared_ptr< State > &
) 

Implements sdm::DeterministicDecisionRule::elementExist

function getProbability [1/3]

double sdm::JointDeterministicDecisionRule::getProbability (
    const Joint < std::shared_ptr< State >> & state,
    const Joint < std::shared_ptr< Action >> & action
) const

Parameters:

  • state the joint state
  • action the joint action
  • proba the probability

function getProbability [2/3]

virtual double sdm::JointDeterministicDecisionRule::getProbability (
    const std::shared_ptr< State > & state,
    const std::shared_ptr< Action > & action
) const

Parameters:

  • s the state
  • a the action

Returns:

the probability

Implements sdm::DeterministicDecisionRule::getProbability

function getProbability [3/3]

double sdm::JointDeterministicDecisionRule::getProbability (
    const std::shared_ptr< State > & state,
    const std::shared_ptr< Action > & action,
    const number & agent_id
) const

Parameters:

  • agent_id the agent identifier
  • state the state
  • action the action

Returns:

the probability selecting action 'action' in state 'state'

function setProbability [1/2]

void sdm::JointDeterministicDecisionRule::setProbability (
    const Joint < std::shared_ptr< State >> & state,
    const Joint < std::shared_ptr< Action >> & action,
    double proba=0
) 

Parameters:

  • state the joint state
  • action the joint action
  • proba the probability

function setProbability [2/2]

virtual void sdm::JointDeterministicDecisionRule::setProbability (
    const std::shared_ptr< State > & state,
    const std::shared_ptr< Action > & action,
    double proba=1
) 

Parameters:

  • s the state
  • a the action
  • proba the probability

Implements sdm::DeterministicDecisionRule::setProbability

function str

virtual std::string sdm::JointDeterministicDecisionRule::str () const

Implements sdm::DeterministicDecisionRule::str

Friends Documentation

friend operator<<

inline friend std::ostream & sdm::JointDeterministicDecisionRule::operator<< (
    std::ostream & os,
    const JointDeterministicDecisionRule & joint_dr
) 

The documentation for this class was generated from the following file src/sdm/core/action/joint_det_decision_rule.hpp