MachineIntelligenceCore:ReinforcementLearning
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
mic::algorithms::MazeHistogramFilter Class Reference

Class implementing a histogram filter based solution of the maze-of-digits localization problem. More...

#include <MazeHistogramFilter.hpp>

Public Member Functions

 MazeHistogramFilter ()
 
void setMazes (std::vector< mic::types::MatrixXiPtr > &mazes_, unsigned int number_of_distinctive_patches_)
 
void setHiddenPose (int hidden_maze_number_, int hidden_x_, int hidden_y_)
 
virtual ~MazeHistogramFilter ()
 
void assignInitialProbabilities ()
 
void sense (double hit_factor_, double miss_factor_)
 
void move (mic::types::Action2DInterface ac_)
 
void probabilisticMove (mic::types::Action2DInterface ac_, double exact_move_probability_, double overshoot_move_probability_, double undershoot_move_probability_)
 
void updateAggregatedProbabilities ()
 
mic::types::Action2DInterface mostUniquePatchActionSelection ()
 
mic::types::Action2DInterface sumOfMostUniquePatchesActionSelection ()
 

Public Attributes

std::vector
< mic::types::MatrixXdPtr > 
maze_position_probabilities
 Variable storing the probability that we are in a given maze position. More...
 
std::vector< double > maze_probabilities
 Variable storing the probability that we are currently moving in/observing a given maze. More...
 
std::vector< double > maze_x_coordinate_probilities
 Variable storing the probability that we are currently in a given x coordinate. More...
 
std::vector< double > maze_y_coordinate_probilities
 Variable storing the probability that we are currently in a given y coordinate. More...
 
std::vector< double > maze_patch_probabilities
 Variable storing the probability that we can find given patch in a given maze. More...
 
int hidden_maze_number
 shortariable denoting in which maze are we right now (unknown, to be determined). More...
 
int hidden_x
 Variable denoting the x position are we right now (unknown, to be determined). More...
 
int hidden_y
 Variable denoting the y position are we right now (unknown, to be determined). More...
 
short obs
 Current Observation. More...
 

Private Attributes

std::vector
< mic::types::MatrixXiPtr > 
mazes
 List of mazes. More...
 
unsigned int number_of_mazes
 Problem dimensions - number of mazes. More...
 
unsigned int number_of_distinctive_patches
 Problem dimensions - number of distinctive patches (in here - number of different digits, i.e. 10). More...
 
unsigned int maze_width
 Width of maze. More...
 
unsigned int maze_height
 Height of maze. More...
 
unsigned int problem_dimensions
 Problem dimensions - number of mazes * their width * their height. More...
 

Detailed Description

Class implementing a histogram filter based solution of the maze-of-digits localization problem.

Author
tkornuta

Definition at line 42 of file MazeHistogramFilter.hpp.

Constructor & Destructor Documentation

mic::algorithms::MazeHistogramFilter::MazeHistogramFilter ( )
virtual mic::algorithms::MazeHistogramFilter::~MazeHistogramFilter ( )
inlinevirtual

Destructor. Empty for now.

Definition at line 68 of file MazeHistogramFilter.hpp.

Member Function Documentation

mic::types::Action2DInterface mic::algorithms::MazeHistogramFilter::mostUniquePatchActionSelection ( )

Selects action based on analysis of current state and patch distributions. The functions tries to find the maximum action utility, taking into consideration probabilities of being in given maze in given x,y-position.

Definition at line 318 of file MazeHistogramFilter.cpp.

References maze_height, maze_patch_probabilities, maze_position_probabilities, maze_width, mazes, and number_of_mazes.

Referenced by mic::application::EpisodicHistogramFilterMazeLocalization::performSingleStep(), and mic::application::HistogramFilterMazeLocalization::performSingleStep().

void mic::algorithms::MazeHistogramFilter::move ( mic::types::Action2DInterface  ac_)

Performs "deterministic" move.

Parameters
ac_Performed action.

Definition at line 194 of file MazeHistogramFilter.cpp.

References hidden_maze_number, hidden_x, hidden_y, maze_height, maze_position_probabilities, maze_width, mazes, and number_of_mazes.

void mic::algorithms::MazeHistogramFilter::probabilisticMove ( mic::types::Action2DInterface  ac_,
double  exact_move_probability_,
double  overshoot_move_probability_,
double  undershoot_move_probability_ 
)

Performs "probabilistic" move.

Parameters
ac_Performed action.
exact_move_probability_Probability that we made the exact move (pos+dpos).
overshoot_move_probability_Probability that we made the "overshoot" move (pos+dpos+1).
undershoot_move_probability_Probability that we made the "undershoot" move (pos+dpos-1).

Definition at line 228 of file MazeHistogramFilter.cpp.

References hidden_maze_number, hidden_x, hidden_y, maze_height, maze_position_probabilities, maze_width, mazes, and number_of_mazes.

Referenced by mic::application::EpisodicHistogramFilterMazeLocalization::performSingleStep(), and mic::application::HistogramFilterMazeLocalization::performSingleStep().

void mic::algorithms::MazeHistogramFilter::sense ( double  hit_factor_,
double  miss_factor_ 
)

Performs "probabilistic" sensing - update probabilities basing on the current observation.

Parameters
hit_factor_hit factor (the gain when the observation coincides with current position).
miss_factor_miss factor (the gain when the observation does not coincide with current position).

Definition at line 145 of file MazeHistogramFilter.cpp.

References hidden_maze_number, hidden_x, hidden_y, maze_height, maze_position_probabilities, maze_width, mazes, number_of_mazes, and obs.

Referenced by mic::application::HistogramFilterMazeLocalization::initializePropertyDependentVariables(), mic::application::HistogramFilterMazeLocalization::performSingleStep(), mic::application::EpisodicHistogramFilterMazeLocalization::performSingleStep(), and mic::application::EpisodicHistogramFilterMazeLocalization::startNewEpisode().

void mic::algorithms::MazeHistogramFilter::setHiddenPose ( int  hidden_maze_number_,
int  hidden_x_,
int  hidden_y_ 
)

Sets hidden pose. If required

Parameters
hidden_maze_number_Hidden maze number (-1 = random)
hidden_x_Maze x coordinate (-1 = random)
hidden_y_Maze y coordinate (-1 = random)

Definition at line 63 of file MazeHistogramFilter.cpp.

References hidden_maze_number, hidden_x, hidden_y, maze_height, maze_width, and number_of_mazes.

Referenced by mic::application::HistogramFilterMazeLocalization::initializePropertyDependentVariables(), and mic::application::EpisodicHistogramFilterMazeLocalization::startNewEpisode().

void mic::algorithms::MazeHistogramFilter::setMazes ( std::vector< mic::types::MatrixXiPtr > &  mazes_,
unsigned int  number_of_distinctive_patches_ 
)
mic::types::Action2DInterface mic::algorithms::MazeHistogramFilter::sumOfMostUniquePatchesActionSelection ( )

Selects action based on analysis of current state and patch distributions. The functions finds the maximum action utility, summing the results of taking given action taking into account the probabilities of being in given maze in given x,y-position.

Definition at line 359 of file MazeHistogramFilter.cpp.

References maze_height, maze_patch_probabilities, maze_position_probabilities, maze_width, mazes, and number_of_mazes.

Referenced by mic::application::EpisodicHistogramFilterMazeLocalization::performSingleStep(), and mic::application::HistogramFilterMazeLocalization::performSingleStep().

Member Data Documentation

int mic::algorithms::MazeHistogramFilter::hidden_maze_number
int mic::algorithms::MazeHistogramFilter::hidden_x
int mic::algorithms::MazeHistogramFilter::hidden_y
unsigned int mic::algorithms::MazeHistogramFilter::maze_height
private
std::vector<double> mic::algorithms::MazeHistogramFilter::maze_patch_probabilities
std::vector<mic::types::MatrixXdPtr> mic::algorithms::MazeHistogramFilter::maze_position_probabilities
std::vector<double> mic::algorithms::MazeHistogramFilter::maze_x_coordinate_probilities
std::vector<double> mic::algorithms::MazeHistogramFilter::maze_y_coordinate_probilities
std::vector<mic::types::MatrixXiPtr> mic::algorithms::MazeHistogramFilter::mazes
private
unsigned int mic::algorithms::MazeHistogramFilter::number_of_distinctive_patches
private

Problem dimensions - number of distinctive patches (in here - number of different digits, i.e. 10).

Definition at line 126 of file MazeHistogramFilter.hpp.

Referenced by assignInitialProbabilities(), MazeHistogramFilter(), and setMazes().

unsigned int mic::algorithms::MazeHistogramFilter::number_of_mazes
private
unsigned int mic::algorithms::MazeHistogramFilter::problem_dimensions
private

Problem dimensions - number of mazes * their width * their height.

Definition at line 135 of file MazeHistogramFilter.hpp.

Referenced by assignInitialProbabilities(), MazeHistogramFilter(), and setMazes().


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