CRAAM
2.0.0
Robust and Approximate Markov Decision Processes
|
Turns arbitrary samples to discrete ones (with continuous numbers assigned to states) assuming that actions are state dependent. More...
#include <Samples.hpp>
Public Member Functions | |
SampleDiscretizerSD () | |
Constructs new internal discrete samples. | |
void | add_samples (const Samples< State, Action > &samples) |
Adds samples to the discrete samples. | |
long | add_state (const State &dstate) |
Returns a state index, and creates a new one if it does not exists. | |
long | add_action (const State &dstate, const Action &action) |
Returns an action index, and creates a new one if it does not exists. | |
shared_ptr< DiscreteSamples > | get_discrete () |
Returns a shared pointer to the discrete samples. | |
Protected Attributes | |
shared_ptr< DiscreteSamples > | discretesamples |
unordered_map< pair< State, Action >, long, SAHash > | action_map |
unordered_map< State, long, SHash > | action_count |
keeps the number of actions for each state | |
unordered_map< State, long, SHash > | state_map |
Turns arbitrary samples to discrete ones (with continuous numbers assigned to states) assuming that actions are state dependent.
The internally-held discrete samples can be accessed and modified from the outside. Also, adding more samples will modify the discrete samples.
See SampleDiscretizerSI for a version in which action names are independent of states.
A new hash function can be defined as follows:
State | Type of state in the source samples |
Action | Type of action in the source samples |
SAhash | Hash function for pair<State, Action> |
Shash | Hash function for decision states |
A hash function hash<type> for each sample type must exists.