refine_plan.models.dbn_option

Subclass of Option for options represented using dynamic Bayesian networks.

Author: Charlie Street Owner: Charlie Street

Module Contents

Classes

DBNOption

A subclass of options represented using dynamic Bayesian networks.

class refine_plan.models.dbn_option.DBNOption(name, transition_dbn_path, reward_dbn_path, sf_list, enabled_cond, prune_dists=True)

Bases: refine_plan.models.option.Option

A subclass of options represented using dynamic Bayesian networks.

DBNs are passed in as files using the .bifxml format used by pyAgrum. The DBNs assume all state factor values are strings. This is to stop lookup errors with integers. States can be passed in without considering this however. The transition function uses up to two variables for each state factor sf: sf0 and sft. The reward function should just use one variable per state factor, and one more called r which represents the reward. Some state factors may not appear in the transition or reward DBNs.

Same as superclass, plus
_transition_dbn

The transition function DBN.

_reward_dbn

The reward function DBN.

_sf_list

The list of state factors that make up the state space

_enabled_cond

A Condition which captures the states where this option is enabled

get_transition_prob(state, next_state)

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

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 the reward for

Returns:

The reward at 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