#ifndef __PROBLEMDOMAIN_H_
#define __PROBLEMDOMAIN_H_

#include "Definitions.h"

#include <cstddef>

class ProblemDomain {
	public:
		static const FloatType POSITIVE_INFINITY, NEGATIVE_INFINITY;
		struct TournamentReturn {
			enum Winner { LEFT, RIGHT, TIE };
			TournamentReturn(Winner w, FloatType f) : winner(w), winningFitness(f) {}
			Winner winner;
			FloatType winningFitness;
		};
		
  protected:
		ProblemDomain() : numberOfGenes( 0 ), numberOfAlleles( NULL ) { /* Empty */ }
		virtual ~ProblemDomain() { /* Empty */ }
		unsigned numberOfGenes;
    AlleleType *numberOfAlleles;

  public:
		virtual bool isGood() const = 0;
		virtual TournamentReturn tournament( AlleleType *phenotypeLeft, AlleleType *phenotypeRight ) const;
    virtual FloatType getFitness( AlleleType *phenotype ) const = 0;

    unsigned getNumberOfGenes() const { return numberOfGenes; }
    AlleleType * getNumberOfAlleles() const { return numberOfAlleles; }

};

#endif /* __PROBLEMDOMAIN_H_ */
