refine_plan.models.policy
Class for deterministic memoryless policies.
Author: Charlie Street Owner: Charlie Street
Module Contents
Classes
Data class for deterministic memoryless policies. |
- class refine_plan.models.policy.Policy(state_action_dict, value_dict=None, policy_file=None)
Bases:
object
Data class for deterministic memoryless policies.
- _state_action_dict
A dictionary from states to actions
- _value_dict
A dictionary from states to values under that policy
- get_action(state)
Return the policy action for a given state.
- Parameters:
state – The state we want an action for
- Returns:
The policy action
- get_value(state)
Return the value at a given state.
- Parameters:
state – The state we want to retrieve the value for
- Returns:
The value at state
- Raises:
no_value_dict_exception – Raised if there is no value dictionary
- write_policy(out_file)
Write a policy with all state factor information to a YAML file.
- Parameters:
out_file – The yaml file to write to