/*****************************************************
**
**  S-PRES Copyright (c) 2010
**
**  Joshua T Berryman
**
**  This file is part of S-PRES
**
**  S-PRES is Free software: you can redistribute it and/or modify
**  it under the terms of the GNU General Public License as published by
**  the Free Software Foundation, either version 3 of the License, or
**  (at your option) any later version.
**
**  S-PRES is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
**  GNU General Public License for more details.
**
**  You should have received a copy of the GNU General Public License
**  along with this program.  If not, see <http://www.gnu.org/licenses/>.
**
**  If you make use of this program for research 
**  resulting in a publication, please cite:
**
**  Joshua T Berryman and Tanja Schilling, 
**  Sampling rare events in nonequilibrium and nonstationary systems. 
**  
**  J Chem Phys, 133(24):244101, Dec 2010.
**
******************************************************/
#ifndef HAVE_SIMULATION
#define HAVE_SIMULATION


using namespace std;

/** "simulation" is an abstract class
*** which the class responsible for whatever dynamics 
*** are being accelerated here must inherit.
*** To see how to implement these, just look in one of the example dynamics classes
*** which are distributed with this S-PRES wrapper class. 
***
*** To define your dynamics class as "implementing" the simulation abstract class,
*** then type something like this in the class definition:
***
*** #include "simulation.h"
*** class myMolecularDynamicsSystem : public simulation{ 
***/ 
class simulation{
         
 public:
   
  //these are the important functions that need to be implemented
  virtual void            stepTime()                       = 0;//run dynamics for tau timesteps
  virtual void            reset()                          = 0;//randomise the state
    
  //these methods are used to find the reaction coordinate and any observables
  virtual void            calcMyStats()                    = 0;//ensure RC and observables are up to date
  virtual double          get_reactionCoordinate()         = 0;//return the RC
  virtual double         *get_derivedData( int *count )    = 0;//return the observable as a histogram with the number of bins in *count
    
  //these are "get" methods for finding out variables which describe the setup
  virtual double          get_spresCriterionMax()          = 0;
  virtual double          get_spresCriterionMin()          = 0;
  virtual string          get_stateVectorFileName()        = 0;

  virtual string          get_spresLogFileName()           = 0;
  virtual string          get_spresRatesFileName()         = 0;
  virtual int             get_spresNumCompleteMatrices()   = 0;
  
  //get a pointer to the RNG seed.... this is needed in order to "branch" trajectories
  virtual long int       *get_iran()                       = 0; 
  
  //these methods are used to save and reload state information
  virtual simulation     *copySelf()                       = 0;//return a duplicate of my data structure (not neccessarily of all state info though)
  virtual void            reLoad( istream *inStream )      = 0;//refresh state from an iostream, which can be a stringstream
  virtual unsigned int    save( ostream *outStream )       = 0;//save state to an iostream, and return the number of bytes written.
  
  
};


#endif
