RLRP routing  v.0.1.0
rl_logic.ActionSelector Class Reference

Class for selecting the action from the list of actions and their corresponding values. More...

Collaboration diagram for rl_logic.ActionSelector:
Collaboration graph

Public Member Functions

def __init__ (self, selection_method_id="greedy")
 Constructor. More...
 
def select_action (self)
 Default method for selecting the action. More...
 
def select_action_greedy (self, action_values)
 Select an action using "greedy" algorithm. More...
 
def select_action_e_greedy (self, action_values)
 Select an action using "e-greedy" algorithm. More...
 
def select_action_softmax (self, action_values)
 Select an action using "soft-max" algorithm, based on Gibbs (Boltzmann) distribution. More...
 

Public Attributes

 select_action
 A reference to the selection method being used. More...
 
 selection_method_id
 Store a selection method ID value. More...
 
 eps
 Eps-value for the e-greedy selection method. More...
 

Detailed Description

Class for selecting the action from the list of actions and their corresponding values.

The interface is provided via select_action() method.

Constructor & Destructor Documentation

def rl_logic.ActionSelector.__init__ (   self,
  selection_method_id = "greedy" 
)

Constructor.

Parameters
selfThe object pointer.
selfID of used selection method.

Member Function Documentation

def rl_logic.ActionSelector.select_action (   self)

Default method for selecting the action.

It is overridden in init(). Input: {action_id: value}. Output: action_id.

Parameters
selfThe object pointer.
def rl_logic.ActionSelector.select_action_e_greedy (   self,
  action_values 
)

Select an action using "e-greedy" algorithm.

Parameters
selfThe object pointer.
action_valuesA dictionary containing {action_id: estimation_value}.
Returns
The selected action_id.

Here is the call graph for this function:

def rl_logic.ActionSelector.select_action_greedy (   self,
  action_values 
)

Select an action using "greedy" algorithm.

Parameters
selfThe object pointer.
action_valuesA dictionary containing {action_id: estimation_value}.
Returns
The action_id with the maximum value.

Here is the caller graph for this function:

def rl_logic.ActionSelector.select_action_softmax (   self,
  action_values 
)

Select an action using "soft-max" algorithm, based on Gibbs (Boltzmann) distribution.

See the reference in R.Sutton's book: Reinforcement Learning: An Introduction.

Parameters
selfThe object pointer.
action_valuesA dictionary containing {action_id: estimation_value}.
Returns
The selected action_id.

Member Data Documentation

rl_logic.ActionSelector.eps

Eps-value for the e-greedy selection method.

Default value is 0.1.

rl_logic.ActionSelector.select_action

A reference to the selection method being used.

rl_logic.ActionSelector.selection_method_id

Store a selection method ID value.


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