openModeller  Version 1.5.0
NegatedRangeRule Class Reference

#include <Rule.h>

Inheritance diagram for NegatedRangeRule:
Inheritance graph
Collaboration diagram for NegatedRangeRule:
Collaboration graph

Public Member Functions

 NegatedRangeRule ()
 
virtual ~NegatedRangeRule ()
 
virtual RuleobjFactory ()
 
virtual char type () const
 
virtual void fromString (char *strRule)
 
virtual bool applyToCell (EnvCell *cell)
 
virtual double getStrength (EnvCell *cell)
 
 NegatedRangeRule ()
 
 NegatedRangeRule (int numGenes)
 
 NegatedRangeRule (Scalar prediction, int numGenes, const Sample &chrom1, const Sample &chrom2, const double *performances)
 Constructor with setters. More...
 
virtual ~NegatedRangeRule ()
 
virtual GarpRuleobjFactory () const
 
virtual char type () const
 
virtual bool applies (const Sample &sample) const
 
virtual int getStrength (const Sample &sample) const
 
void log ()
 
- Public Member Functions inherited from RangeRule
 RangeRule ()
 
virtual ~RangeRule ()
 
virtual void initialize (EnvCellSet *objEnvCellSet, const RuleSet *objRuleSet, bool *geneIsActivePtr, int *geneIndexPtr, int iActGenes)
 
void bioclimRange (EnvCellSet *objEnvCellSet, BYTE pred, double level, int var)
 
 RangeRule ()
 
 RangeRule (int numGenes)
 
 RangeRule (Scalar prediction, int numGenes, const Sample &chrom1, const Sample &chrom2, const double *performances)
 Constructor with setters. More...
 
virtual ~RangeRule ()
 
virtual void initialize (const BioclimHistogram &histogram)
 
void log ()
 
- Public Member Functions inherited from GarpRule
 GarpRule ()
 
virtual ~GarpRule ()
 
 GarpRule ()
 Default constructor. More...
 
 GarpRule (const int numGenes)
 Constructor with defined size. More...
 
 GarpRule (Scalar prediction, int numGenes, const Sample &chrom1, const Sample &chrom2, const double *performances)
 Constructor with setters. More...
 
virtual ~GarpRule ()
 Default destructor. More...
 
virtual GarpRuleclone () const
 
virtual int copy (const GarpRule *fromRule)
 
int numGenes () const
 
bool needsEvaluation () const
 
void forceEvaluation ()
 
void evaluated ()
 
void setPrediction (double pred)
 
Scalar getPrediction () const
 
const SamplegetChrom1 () const
 
const SamplegetChrom2 () const
 
const double * getPerformanceArray () const
 
double getPerformance (PerfIndex perfIndex) const
 
virtual int getCertainty (const Scalar pred) const
 
virtual double getError (const Scalar predefinedValue, const Scalar prediction) const
 
virtual bool similar (const GarpRule *compareToRule) const
 
virtual void mutate (double temperature)
 
virtual void crossover (GarpRule *rule, int xpt1, int xpt2)
 
void adjustRange (Scalar &v1, Scalar &v2) const
 
double evaluate (const OccurrencesPtr &occs)
 
- Public Member Functions inherited from Rule
 Rule ()
 Default constructor. More...
 
virtual ~Rule ()
 Default destructor. More...
 
virtual Ruleclone ()
 
virtual void copy (Rule *fromRule)
 
void RestoreRule (double *perf, unsigned char *genes, int arry_len, int *gene_index)
 Restore Model. More...
 
virtual char * toString ()
 
virtual char * toXML ()
 
virtual double getCertainty (EnvCell *cell)
 
virtual double getError (BYTE pred, EnvCell *cell)
 
virtual bool similar (Rule *objOtherRule)
 
virtual void mutate (int intTemperature)
 
double testWithData (EnvCellSet *objTrainSet)
 
bool needsEvaluation ()
 

Additional Inherited Members

- Protected Attributes inherited from GarpRule
Sample _chrom1
 BYTE vector containing the genes (representation of the variables in a Genetic Algorithm. More...
 
Sample _chrom2
 
Scalar _prediction
 
int _numGenes
 Number of genes stored by the rule. More...
 
double _performance [10]
 Vector for storing the performance values for the rule. More...
 
bool _needsEvaluation
 
char _origin
 
- Protected Attributes inherited from Rule
BYTEGene
 BYTE vector containing the genes (representation of the variables in a Genetic Algorithm. More...
 
int intGenes
 Number of genes stored by the rule. More...
 
double dblPerformance [10]
 Vector for storing the performance values for the rule. More...
 
bool blnNeedsEvaluation
 
int intGens
 
int intTrials
 
int intScreener
 
int intScreen
 
int intLength
 
int intNumber
 
int intConclusion
 
char chrOrigin
 
char chrPad
 
int lId
 
int iOrigGen
 
double _pXYs
 
int _no
 
double _dA
 
double _dSig
 
bool * bGeneIsActive
 
int * iGeneIndex
 
int iActiveGenes
 

Detailed Description

Implements Garp Negated Range rules. They are simply a negation of an equivalent Range rule. Examples of Negated Range rules are:

IF NOT (temp between 10 and 20C) THEN sp=PRESENT IF NOT (temp between 10 and 20C AND elevation between 500 and 2000m) THEN sp=ABSENT

Definition at line 146 of file Rule.h.

Constructor & Destructor Documentation

NegatedRangeRule::NegatedRangeRule ( )

Definition at line 620 of file Rule.cpp.

Referenced by objFactory().

NegatedRangeRule::~NegatedRangeRule ( )
virtual

Definition at line 622 of file Rule.cpp.

NegatedRangeRule::NegatedRangeRule ( )
NegatedRangeRule::NegatedRangeRule ( int  numGenes)

Definition at line 52 of file rules_negrange.cpp.

NegatedRangeRule::NegatedRangeRule ( Scalar  prediction,
int  numGenes,
const Sample chrom1,
const Sample chrom2,
const double *  performances 
)

Constructor with setters.

Definition at line 56 of file rules_negrange.cpp.

virtual NegatedRangeRule::~NegatedRangeRule ( )
virtual

Member Function Documentation

bool NegatedRangeRule::applies ( const Sample sample) const
virtual

Reimplemented from RangeRule.

Definition at line 66 of file rules_negrange.cpp.

References GarpRule::_chrom1, GarpRule::_chrom2, GarpRule::_numGenes, between(), and equalEps().

Here is the call graph for this function:

bool NegatedRangeRule::applyToCell ( EnvCell cell)
virtual

Reimplemented from RangeRule.

Definition at line 629 of file Rule.cpp.

References Rule::Gene, Rule::iActiveGenes, Rule::iGeneIndex, Rule::intLength, GarpUtil::notBetween(), and EnvCell::values.

Here is the call graph for this function:

void NegatedRangeRule::fromString ( char *  strRule)
virtual

Reimplemented from RangeRule.

Definition at line 624 of file Rule.cpp.

int NegatedRangeRule::getStrength ( const Sample sample) const
virtual

Reimplemented from RangeRule.

Definition at line 82 of file rules_negrange.cpp.

References RangeRule::getStrength().

Here is the call graph for this function:

double NegatedRangeRule::getStrength ( EnvCell cell)
virtual

Reimplemented from RangeRule.

Definition at line 650 of file Rule.cpp.

References RangeRule::getStrength().

Here is the call graph for this function:

void NegatedRangeRule::log ( )
virtual

Reimplemented from GarpRule.

Definition at line 93 of file rules_negrange.cpp.

References Log::info(), Log::instance(), and GarpRule::log().

Here is the call graph for this function:

virtual GarpRule* NegatedRangeRule::objFactory ( ) const
inlinevirtual

Reimplemented from RangeRule.

Definition at line 67 of file rules_negrange.hh.

References NegatedRangeRule().

Here is the call graph for this function:

virtual Rule* NegatedRangeRule::objFactory ( )
inlinevirtual

Reimplemented from RangeRule.

Definition at line 151 of file Rule.h.

References NegatedRangeRule().

Here is the call graph for this function:

virtual char NegatedRangeRule::type ( ) const
inlinevirtual

Reimplemented from RangeRule.

Definition at line 69 of file rules_negrange.hh.

virtual char NegatedRangeRule::type ( ) const
inlinevirtual

Reimplemented from RangeRule.

Definition at line 153 of file Rule.h.


The documentation for this class was generated from the following files: