#ifndef COMPUCELL3DMINIMALCLOCK_H
#define COMPUCELL3DMINIMALCLOCK_H


#include <CompuCell3D/Steppable.h>
#include <CompuCell3D/Potts3D/Cell.h>
#include <string>
#include <vector>
#include <iostream>


namespace CompuCell3D {

/**
@author m
*/
//forward declarations
class Potts3D;
class Simulator;
class CellG;
class CellInventory;
class Automaton;


class MinimalClock :public Steppable
{
protected:

   Potts3D *potts;
   Simulator *simPtr;
   
   unsigned int currentStep;
   
   CellInventory *cellInventoryPtr;
   std::vector<std::vector<CellG*> > cell2DArray;
   std::vector<std::vector<bool> > state2DArray0;
   std::vector<std::vector<bool> > state2DArray1;
   unsigned int xSize,ySize;
   Automaton * automaton;
   
public:
    MinimalClock();

    virtual ~MinimalClock();
    
   
    virtual void init(Simulator *simulator);

    // Begin Steppable interface
    virtual void start();
    virtual void step(const unsigned int _currentStep);
    virtual void finish() {}
    // End Steppable interface

    // Begin XMLSerializable interface
    virtual void readXML(XMLPullParser &in);
    virtual void writeXML(XMLSerializer &out){};
    // End XMLSerializable interface
private:
   unsigned int position(std::vector<unsigned int> & cmVec, unsigned int cmPos);
    
};

};

#endif
