36 #ifndef _RULES_BASE_HH_
37 #define _RULES_BASE_HH_
109 bool equalEps(
double v1,
double v2);
110 bool between(
double value,
double min,
double max);
111 int membership(
double value1,
double value2,
double value);
135 const double * performances);
152 virtual char type()
const {
return 'v'; }
169 virtual void mutate(
double temperature);
virtual void crossover(GarpRule *rule, int xpt1, int xpt2)
double _performance[10]
Vector for storing the performance values for the rule.
double Scalar
Type of map values.
bool equalEps(double v1, double v2)
bool needsEvaluation() const
Sample _chrom1
BYTE vector containing the genes (representation of the variables in a Genetic Algorithm.
double evaluate(const OccurrencesPtr &occs)
void setPrediction(double pred)
const Sample & getChrom1() const
void adjustRange(Scalar &v1, Scalar &v2) const
bool between(double value, double min, double max)
virtual GarpRule * objFactory() const =0
int _numGenes
Number of genes stored by the rule.
virtual GarpRule * clone() const
virtual int copy(const GarpRule *fromRule)
virtual bool applies(const Sample &sample) const =0
virtual void mutate(double temperature)
Scalar getPrediction() const
virtual int getStrength(const Sample &sample) const =0
virtual char type() const
virtual int getCertainty(const Scalar pred) const
const double * getPerformanceArray() const
double getPerformance(PerfIndex perfIndex) const
virtual double getError(const Scalar predefinedValue, const Scalar prediction) const
const Sample & getChrom2() const
int membership(double value1, double value2, double value)
virtual bool similar(const GarpRule *compareToRule) const