refine_plan.models.option

Class for options, which are temporally extended actions.

Author: Charlie Street Owner: Charlie Street

Module Contents

Classes

Option

An option is a temporally extended behaviour.

class refine_plan.models.option.Option(name, transition_list, reward_list)

Bases: object

An option is a temporally extended behaviour.

Options are traditionally defined in terms of an initiation set I, a termination condition beta, and a policy pi.

Here, we just define the option in terms of its transition probabilities (assuming no preemption occurs) and reward model.

_name

The option’s name

_transition_list

The option’s transition model

_reward_list

The option’s reward model

get_name()

Return the option’s name.

Returns:

The option’s name

get_transition_prob(state, next_state)

Return the transition probability for a (s,s’) pair.

Assumes there is only one precondition which holds for each state.

Parameters:
  • state – The first state

  • next_state – The next state

Returns:

The transition probability

get_reward(state)

Return the reward for executing an option in a given state.

Parameters:

state – The state we want to check

Returns:

The reward for the state

get_transition_prism_string()

Return a PRISM string which captures all transitions for this option.

Returns:

The transition PRISM string

get_reward_prism_string()

Return a PRISM string which captures all rewards for this option.

Returns:

The reward PRISM string