Class sdm::DeterministicDecisionRule
Class List > sdm > DeterministicDecisionRule
This class provide a way to manipulate data relative to a deterministic decision rule. More...
#include <det_decision_rule.hpp>
Inherits the following classes: sdm::DecisionRule
Inherited by the following classes: sdm::JointDeterministicDecisionRule
Public Types inherited from sdm::Function
See sdm::Function
Type | Name |
---|---|
typedef TInput | input_type |
typedef TOutput | output_type |
Public Functions
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
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
Type | Name |
---|---|
std::map< std::shared_ptr< State >, std::shared_ptr< Action > > | map_state_to_action_ |
Detailed Description
To represent a deterministic decision rule, we simply use a structure that map histories to actions.
Public Functions Documentation
function DeterministicDecisionRule [1/3]
sdm::DeterministicDecisionRule::DeterministicDecisionRule ()
function DeterministicDecisionRule [2/3]
sdm::DeterministicDecisionRule::DeterministicDecisionRule (
const DeterministicDecisionRule & copy
)
function DeterministicDecisionRule [3/3]
sdm::DeterministicDecisionRule::DeterministicDecisionRule (
const std::vector< std::shared_ptr< Item >> & acc_states,
const std::vector< std::shared_ptr< Item >> & n_actions
)
function act
virtual std::shared_ptr< Action > sdm::DeterministicDecisionRule::act (
const std::shared_ptr< State > & state
) const
Parameters:
state
the generic state
Returns:
the corresponding action
Implements sdm::DecisionRule::act
function elementExist
virtual bool sdm::DeterministicDecisionRule::elementExist (
const std::shared_ptr< State > &
)
Implements sdm::DecisionRule::elementExist
function getMap
std::map< std::shared_ptr< State >, std::shared_ptr< Action > > sdm::DeterministicDecisionRule::getMap () const
function getProbability
virtual double sdm::DeterministicDecisionRule::getProbability (
const std::shared_ptr< State > & s,
const std::shared_ptr< Action > & a
) const
Parameters:
s
the statea
the action
Returns:
the probability
Implements sdm::DecisionRule::getProbability
function setProbability
virtual void sdm::DeterministicDecisionRule::setProbability (
const std::shared_ptr< State > & s,
const std::shared_ptr< Action > & a,
double proba=1
)
Parameters:
s
the statea
the actionproba
the probability
Implements sdm::DecisionRule::setProbability
function str
virtual std::string sdm::DeterministicDecisionRule::str () const
Implements sdm::DecisionRule::str
Protected Attributes Documentation
variable map_state_to_action_
std::map<std::shared_ptr<State>, std::shared_ptr<Action> > sdm::DeterministicDecisionRule::map_state_to_action_;
Friends Documentation
friend operator<<
inline friend std::ostream & sdm::DeterministicDecisionRule::operator<< (
std::ostream & os,
const DeterministicDecisionRule & dr
)
The documentation for this class was generated from the following file src/sdm/core/action/det_decision_rule.hpp