# simple_rl.mdp package

## Subpackages

## Submodules

## simple_rl.mdp.MDPClass module

MDPClass.py: Contains the MDP Class.

class `simple_rl.mdp.MDPClass.``MDP`(actions, transition_func, reward_func, init_state, gamma=0.99, step_cost=0)

  Bases: `object`

  Abstract class for a Markov Decision Process.

  `end_of_instance`()
  `execute_agent_action`(action)
    Args:
      action (str)
    Returns:
      (tuple: <float,State>): reward, State
    Summary:
      Core method of all of simple_rl. Facilitates interaction between the MDP and an agent.
  `get_actions`()
  `get_curr_state`()
  `get_gamma`()
  `get_init_state`()
  `get_num_state_feats`()
  `get_parameters`()
    Returns:
      (dict) key=param_name (str) --> val=param_val (object).
  `get_reward_func`()
  `get_slip_prob`()
  `get_transition_func`()
  `reset`()
  `set_gamma`(new_gamma)
  `set_slip_prob`(slip_prob)
  `set_step_cost`(new_step_cost)

## simple_rl.mdp.MDPDistributionClass module

MDPDistributionClass.py: Contains the MDP Distribution Class.

class `simple_rl.mdp.MDPDistributionClass.``MDPDistribution`(mdp_prob_dict, horizon=0)

  Bases: `object`

  Class for distributions over MDPs.

  `get_actions`()
  `get_all_mdps`(prob_threshold=0)
    Args:
      prob_threshold (float)
    Returns:
      (list): Contains all mdps in the distribution with Pr. > @prob_threshold.
  `get_average_reward_func`()
  `get_gamma`()
    Notes:
      Not all MDPs in the distribution are guaranteed to share gamma.
  `get_horizon`()
  `get_init_state`()
    Notes:
      Not all MDPs in the distribution are guaranteed to share init states.
  `get_mdps`()
  `get_num_mdps`()
  `get_parameters`()
    Returns:
      (dict) key=param_name (str) --> val=param_val (object).
  `get_prob_of_mdp`(mdp)
  `get_reward_func`(avg=True)
  `remove_mdp`(mdp)
    Args:
      (MDP)
    Summary:
      Removes @mdp from self.mdp_prob_dict and recomputes the distribution.
  `remove_mdps`(mdp_list)
    Args:
      (list): Contains MDP instances.
    Summary:
      Removes each mdp in @mdp_list from self.mdp_prob_dict and recomputes the distribution.
  `sample`(k=1)
    Args:
      k (int)
    Returns:
      (List of MDP): Samples @k mdps without replacement.
  `set_gamma`(new_gamma)

`simple_rl.mdp.MDPDistributionClass.``main`()

## simple_rl.mdp.StateClass module

class `simple_rl.mdp.StateClass.``State`(data=[], is_terminal=False)

  Bases: `object`

  Abstract State class

  `features`()
    Summary
      Used by function approximators to represent the state. Override this method in State subclasses to have functiona approximators use a different set of features.
    Returns:
      (iterable)
  `get_data`()
  `get_num_feats`()
  `is_terminal`()
  `set_terminal`(is_term=True)

## Module contents