mlpy.mdp.discrete.DiscreteModel¶
-
class
mlpy.mdp.discrete.DiscreteModel(actions=None, **kwargs)[source]¶ Bases:
mlpy.mdp.IMDPModelThe MDP model for discrete states and actions.
Parameters: actions : list[MDPAction] or dict[MDPState, list[MDPAction]], optional
The available actions. If not provided, the actions are read from the MDPAction description.
Attributes
midThe module’s unique identifier. statespaceCollection of states and their state-action information. Methods
add_state(state)Add a new state to the statespace. fit(obs, actions[, labels])Fit the model to the observations and actions of the trajectory. get_actions([state])Retrieve the available actions for the given state. init()Initialize the MDP model. load(filename)Load the state of the module from file. predict_proba(state, action)Predict the probability distribution. print_rewards()Print the state rewards for debugging purposes. print_transitions()Print the state transitions for debugging purposes. sample([state, action])Sample from the probability distribution. save(filename)Save the current state of the module to file. update([experience])Update the model with the agent’s experience.