openModeller
Version 1.5.0
|
#include <Rule.h>
Public Member Functions | |
GarpRule () | |
virtual | ~GarpRule () |
virtual char | type () const |
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 GarpRule * | clone () const |
virtual GarpRule * | objFactory () const =0 |
virtual int | copy (const GarpRule *fromRule) |
int | numGenes () const |
virtual char | type () const |
bool | needsEvaluation () const |
void | forceEvaluation () |
void | evaluated () |
void | setPrediction (double pred) |
Scalar | getPrediction () const |
const Sample & | getChrom1 () const |
const Sample & | getChrom2 () const |
const double * | getPerformanceArray () const |
double | getPerformance (PerfIndex perfIndex) const |
virtual int | getStrength (const Sample &sample) const =0 |
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 |
virtual bool | applies (const Sample &sample) const =0 |
double | evaluate (const OccurrencesPtr &occs) |
virtual void | log () |
Public Member Functions inherited from Rule | |
Rule () | |
Default constructor. More... | |
virtual | ~Rule () |
Default destructor. More... | |
virtual Rule * | objFactory ()=0 |
virtual Rule * | clone () |
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 void | fromString (char *strRule)=0 |
virtual char * | toXML () |
virtual void | initialize (EnvCellSet *objEnvCellSet, const RuleSet *objRuleSet, bool *geneIsActivePtr, int *geneIndexPtr, int iActGenes)=0 |
virtual bool | applyToCell (EnvCell *cell)=0 |
virtual double | getCertainty (EnvCell *cell) |
virtual double | getError (BYTE pred, EnvCell *cell) |
virtual double | getStrength (EnvCell *cell)=0 |
virtual bool | similar (Rule *objOtherRule) |
virtual void | mutate (int intTemperature) |
double | testWithData (EnvCellSet *objTrainSet) |
bool | needsEvaluation () |
Protected Attributes | |
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 | |
BYTE * | Gene |
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 |
Base class for specific Garp rules. Provides the basic interface for methods that all kinds of Garp rules should provide.
GarpRule::GarpRule | ( | ) |
Default constructor.
GarpRule::GarpRule | ( | const int | numGenes | ) |
Constructor with defined size.
Definition at line 99 of file rules_base.cpp.
References _origin, _performance, and type().
|
virtual |
Default destructor.
Definition at line 195 of file rules_base.cpp.
Referenced by mutate().
|
pure virtual |
Implemented in RangeRule, NegatedRangeRule, LogitRule, ExtGarpRule, and DummyRule.
|
virtual |
Returns a copy of the rule. Caller is responsible for deallocating memory for this object when it is done using it.
Definition at line 134 of file rules_base.cpp.
References _chrom1, _chrom2, _needsEvaluation, _numGenes, _origin, _performance, _prediction, and objFactory().
Referenced by Garp::keepFittest(), Garp::select(), and TEST().
|
virtual |
Copy data from another rule to the current rule.
fromRule | Pointer to source rule providing data to set current rule. |
Definition at line 157 of file rules_base.cpp.
References _chrom1, _chrom2, _needsEvaluation, _origin, _performance, _prediction, and type().
Referenced by TEST().
|
virtual |
Definition at line 212 of file rules_base.cpp.
References _chrom1, _chrom2, _origin, forceEvaluation(), and OriginCrossover.
Referenced by Garp::crossover().
double GarpRule::evaluate | ( | const OccurrencesPtr & | occs | ) |
Definition at line 297 of file rules_base.cpp.
References _performance, error, Log::error(), getCertainty(), getError(), getStrength(), Log::instance(), and MIN_SIG_NO.
Referenced by Garp::evaluate().
|
inline |
Definition at line 155 of file rules_base.hh.
References _needsEvaluation.
|
inline |
Definition at line 154 of file rules_base.hh.
References _needsEvaluation.
Referenced by crossover(), and Garp::select().
|
virtual |
Definition at line 183 of file rules_base.cpp.
References _prediction.
Referenced by evaluate(), and TEST().
|
inline |
Definition at line 159 of file rules_base.hh.
References _chrom1.
Referenced by Garp::_getConfiguration(), and TEST().
|
inline |
Definition at line 160 of file rules_base.hh.
References _chrom2.
Referenced by Garp::_getConfiguration(), and TEST().
Definition at line 189 of file rules_base.cpp.
Referenced by evaluate(), and TEST().
double GarpRule::getPerformance | ( | PerfIndex | perfIndex | ) | const |
Definition at line 177 of file rules_base.cpp.
References _performance.
Referenced by GarpRuleSet::gatherRuleSetStats(), GarpRuleSet::insert(), Garp::keepFittest(), LogitRule::log(), log(), GarpRuleSet::performanceSummary(), printPerfs(), and Garp::select().
|
inline |
Definition at line 161 of file rules_base.hh.
References _performance.
Referenced by Garp::_getConfiguration().
|
inline |
Definition at line 158 of file rules_base.hh.
References _prediction.
Referenced by Garp::_getConfiguration(), GarpRuleSet::gatherRuleSetStats(), and GarpRuleSet::getValue().
|
pure virtual |
Implemented in RangeRule, NegatedRangeRule, LogitRule, ExtGarpRule, and DummyRule.
Referenced by evaluate().
|
virtual |
Reimplemented from Rule.
Reimplemented in RangeRule, NegatedRangeRule, and LogitRule.
Definition at line 469 of file rules_base.cpp.
References _chrom1, _chrom2, _numGenes, _prediction, getPerformance(), Log::info(), Log::instance(), and PerfSig.
Referenced by NegatedRangeRule::log(), RangeRule::log(), and GarpRuleSet::log().
|
virtual |
Definition at line 250 of file rules_base.cpp.
References _chrom1, _chrom2, _needsEvaluation, _numGenes, _origin, adjustRange(), Random::get(), and OriginMutation.
Referenced by Garp::mutate().
|
inline |
Definition at line 153 of file rules_base.hh.
References _needsEvaluation.
|
inline |
Definition at line 150 of file rules_base.hh.
References _numGenes.
Referenced by ExtGarpRule::setGenes().
|
pure virtual |
Implemented in RangeRule, NegatedRangeRule, LogitRule, ExtGarpRule, and DummyRule.
Referenced by clone().
|
inline |
Definition at line 156 of file rules_base.hh.
References _prediction.
Referenced by Garp::colonize().
|
virtual |
Reimplemented in LogitRule.
Definition at line 271 of file rules_base.cpp.
References _chrom1, _chrom2, _numGenes, _prediction, equalEps(), and type().
Referenced by TEST().
|
inlinevirtual |
Reimplemented from Rule.
Reimplemented in LogitRule, AtomicRule, NegatedRangeRule, RangeRule, RangeRule, NegatedRangeRule, and LogitRule.
Definition at line 122 of file Rule.h.
Referenced by Garp::_getConfiguration(), copy(), GarpRule(), GarpRuleSet::gatherRuleSetStats(), LogitRule::similar(), and similar().
|
inlinevirtual |
Reimplemented from Rule.
Reimplemented in LogitRule, AtomicRule, NegatedRangeRule, RangeRule, RangeRule, NegatedRangeRule, and LogitRule.
Definition at line 152 of file rules_base.hh.
|
protected |
BYTE vector containing the genes (representation of the variables in a Genetic Algorithm.
Definition at line 180 of file rules_base.hh.
Referenced by NegatedRangeRule::applies(), RangeRule::applies(), clone(), copy(), crossover(), getChrom1(), LogitRule::getStrength(), RangeRule::getStrength(), LogitRule::initialize(), RangeRule::initialize(), LogitRule::log(), log(), mutate(), ExtGarpRule::setGenes(), LogitRule::similar(), and similar().
|
protected |
Definition at line 181 of file rules_base.hh.
Referenced by NegatedRangeRule::applies(), RangeRule::applies(), clone(), copy(), crossover(), getChrom2(), LogitRule::getStrength(), RangeRule::getStrength(), LogitRule::initialize(), RangeRule::initialize(), LogitRule::log(), log(), mutate(), ExtGarpRule::setGenes(), and similar().
|
protected |
Definition at line 189 of file rules_base.hh.
Referenced by clone(), copy(), evaluated(), forceEvaluation(), mutate(), and needsEvaluation().
|
protected |
Number of genes stored by the rule.
Definition at line 185 of file rules_base.hh.
Referenced by NegatedRangeRule::applies(), RangeRule::applies(), clone(), RangeRule::getStrength(), LogitRule::initialize(), RangeRule::initialize(), LogitRule::log(), log(), mutate(), numGenes(), ExtGarpRule::setGenes(), LogitRule::similar(), and similar().
|
protected |
Definition at line 190 of file rules_base.hh.
Referenced by clone(), copy(), crossover(), GarpRule(), and mutate().
|
protected |
Vector for storing the performance values for the rule.
Definition at line 188 of file rules_base.hh.
Referenced by clone(), copy(), evaluate(), GarpRule(), getPerformance(), getPerformanceArray(), and DummyRule::setPerformance().
|
protected |
Definition at line 182 of file rules_base.hh.
Referenced by clone(), copy(), getCertainty(), getPrediction(), RangeRule::initialize(), LogitRule::log(), log(), ExtGarpRule::setPrediction(), setPrediction(), LogitRule::similar(), and similar().