#include "rl_inc.h"
#include <strstream.h>

// This abstract class is the most abstract interface for
// "Player" concept:
// - It observs current situation through parameter of
// <Observation> type.
// - It choose actions to execute.
// - It observs reward/loss caused by its previously taken action.
// - It prints statistics accumulated so far.

template <class Observation, class Action>
class Player {

 public:

  // new run is started : get initial observation & choose action
  virtual Action start_run (Observation* startObserv) = 0;

  // inside run : get current observation ,choose action , update
  // statistics by using knoweledge of the last achieved reward
  virtual Action do_step (Observation* currObserv, double lastReward) = 0;

  // run is finihed : get final observation, update statistics
  virtual void end_run (Observation* currObserv, double lastReward) = 0;

  // print accumulated statistics.
  virtual void print_stats () = 0;

};


// Generic Player Factory definition :
// Parameters for specific player creation are specified by
// <params> string.
// Standard RL players factory is provided in "rl_player.h".
// User may inherit for <PlayerFactory> to create 'custom'
// players.

template <class Observation, class Action>
class PlayerFactory {
  
 public:

  // creates player...
  virtual Player<Observation,Action>*  CreatePlayer (const char* params) = 0;
};









