#ifndef __STOPPINGCONDITIONS_H_
#define __STOPPINGCONDITIONS_H_

#include "SgEngine.h"
#include <vector>

class StoppingConditions {
  public:
    enum ConditionType { GENERATIONS, CONVERGED_ALLELES, CPU_TIME };

  private:
    struct Condition {
      ConditionType type;
      unsigned parameter;
    };
		typedef std::vector<Condition> VectorType;
    VectorType conditions;
		const SgEngine * const engine;
		clock_t startClock;
		inline bool poll(ConditionType type, unsigned parameter, bool verbose) const;

  public:
    StoppingConditions(const SgEngine * const e);
		unsigned getCpuTime() const;
		void add (ConditionType type, unsigned parameter);
		bool pollDisjunctive(bool verbose) const;
		bool pollConjunctive(bool verbose) const;
};

#endif /* __STOPPINGCONDITIONS_H_ */
