// const_policy.h :
// defines Markov policy - always return same action for any
// given state. 

#include <map.h>
#include <functional>

template  <class State,class Action>
class const_policy : public Policy <State,Action> {

  typedef map <State,Action,less<State> > ActionPerState_M;
  ActionPerState_M PolicyActions;

public:

  // return stored predefined action
  virtual Action choose_action (State theState) {

    return PolicyActions[theState];
  }

  // store predefined action
  void set_state_action (State theState, Action theAction) {

    PolicyActions[theState] = theAction;
  }

};


