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[Action] or dict[State, list[Action]
The available actions. If not given, the actions are read from the Action 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. 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.