Class FixedPolicy<S extends State,A extends Action>

java.lang.Object
org.tweetyproject.machinelearning.rl.mdp.FixedPolicy<S,A>
Type Parameters:
S - The type of states
A - The type of actions
All Implemented Interfaces:
Policy<S,A>

public class FixedPolicy<S extends State,A extends Action> extends Object implements Policy<S,A>
A fixed policy for MDPs, i.e., a simple map from states to actions.
Author:
Matthias Thimm
  • Constructor Details

    • FixedPolicy

      public FixedPolicy()
      Creates a new fixed policy
  • Method Details

    • execute

      public A execute(S s)
      Specified by:
      execute in interface Policy<S extends State,A extends Action>
      Parameters:
      s - state
      Returns:
      action
    • isWellFormed

      public boolean isWellFormed(Collection<S> states)
      Checks whether this policy is well-formed, i.e. whether every state in the given set of states is mapped to some action.
      Parameters:
      states - some set of states
      Returns:
      "true" iff this policy is well-formed
    • set

      public void set(S s, A a)
      Sets the action for the given state.
      Parameters:
      s - some state
      a - some action
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object