openModeller
Version 1.4.0
|
#include <Rule.h>
Public Member Functions | |
Rule () | |
Default constructor. | |
virtual | ~Rule () |
Default destructor. | |
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. | |
virtual void | log () |
virtual char | type () const |
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 | |
BYTE * | Gene |
BYTE vector containing the genes (representation of the variables in a Genetic Algorithm. | |
int | intGenes |
Number of genes stored by the rule. | |
double | dblPerformance [10] |
Vector for storing the performance values for the rule. | |
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 |
Friends | |
class | RuleSet |
class | GarpAlgorithm |
class | CJobResultValidator |
Rule::Rule | ( | ) |
Default constructor.
Definition at line 33 of file Rule.cpp.
References _dA, _dSig, _no, _pXYs, bGeneIsActive, blnNeedsEvaluation, chrOrigin, chrPad, dblPerformance, Gene, iActiveGenes, iGeneIndex, intConclusion, intGenes, intGens, intLength, intNumber, intScreen, intScreener, intTrials, iOrigGen, and lId.
Rule::~Rule | ( | ) | [virtual] |
virtual bool Rule::applyToCell | ( | EnvCell * | cell | ) | [pure virtual] |
Implemented in LogitRule, AtomicRule, NegatedRangeRule, and RangeRule.
Rule * Rule::clone | ( | ) | [virtual] |
Definition at line 73 of file Rule.cpp.
References _dA, _dSig, _no, _pXYs, bGeneIsActive, blnNeedsEvaluation, chrOrigin, chrPad, dblPerformance, Gene, iActiveGenes, iGeneIndex, intGenes, intGens, intLength, intScreen, intScreener, intTrials, iOrigGen, lId, and objFactory().
Referenced by GarpAlgorithm::concatenateRuleSets(), GarpAlgorithm::saveRule(), and GarpAlgorithm::select().
void Rule::copy | ( | Rule * | fromRule | ) | [virtual] |
Definition at line 115 of file Rule.cpp.
References _dA, _dSig, _no, _pXYs, bGeneIsActive, blnNeedsEvaluation, chrOrigin, chrPad, dblPerformance, Gene, iActiveGenes, iGeneIndex, intGenes, intGens, intLength, intScreen, intScreener, intTrials, iOrigGen, lId, and type().
Referenced by GarpAlgorithm::concatenateRuleSets().
virtual void Rule::fromString | ( | char * | strRule | ) | [pure virtual] |
Implemented in LogitRule, AtomicRule, NegatedRangeRule, and RangeRule.
double Rule::getCertainty | ( | EnvCell * | cell | ) | [virtual] |
Definition at line 305 of file Rule.cpp.
References Gene, and EnvCell::values.
Referenced by testWithData().
double Rule::getError | ( | BYTE | pred, |
EnvCell * | cell | ||
) | [virtual] |
virtual double Rule::getStrength | ( | EnvCell * | cell | ) | [pure virtual] |
Implemented in LogitRule, AtomicRule, NegatedRangeRule, and RangeRule.
Referenced by testWithData().
void Rule::initialize | ( | EnvCellSet * | objEnvCellSet, |
const RuleSet * | objRuleSet, | ||
bool * | geneIsActivePtr, | ||
int * | geneIndexPtr, | ||
int | iActGenes | ||
) | [pure virtual] |
Implemented in LogitRule, AtomicRule, and RangeRule.
Definition at line 180 of file Rule.cpp.
References bGeneIsActive, blnNeedsEvaluation, chrOrigin, chrPad, EnvCellSet::count(), Gene, EnvCellSet::get(), iActiveGenes, iGeneIndex, intConclusion, intGenes, intGens, intLength, intScreen, intTrials, GarpUtil::randint(), EnvCell::size(), type(), and EnvCell::values.
Referenced by GarpAlgorithm::colonize().
void Rule::log | ( | ) | [virtual] |
Reimplemented in GarpRule, RangeRule, NegatedRangeRule, and LogitRule.
Definition at line 904 of file Rule.cpp.
References dblPerformance, Gene, intGenes, and type().
Referenced by RuleSet::log().
void Rule::mutate | ( | int | intTemperature | ) | [virtual] |
Reimplemented in LogitRule.
Definition at line 313 of file Rule.cpp.
References blnNeedsEvaluation, chrOrigin, Gene, iActiveGenes, iGeneIndex, intGens, intLength, GarpUtil::randint(), and type().
Referenced by GarpAlgorithm::mutate().
bool Rule::needsEvaluation | ( | ) | [inline] |
Definition at line 108 of file Rule.h.
References blnNeedsEvaluation.
Referenced by GarpAlgorithm::evaluate().
virtual Rule* Rule::objFactory | ( | ) | [pure virtual] |
Implemented in LogitRule, AtomicRule, NegatedRangeRule, and RangeRule.
Referenced by clone().
void Rule::RestoreRule | ( | double * | perf, |
unsigned char * | genes, | ||
int | arry_len, | ||
int * | gene_index | ||
) |
Restore Model.
Definition at line 156 of file Rule.cpp.
References dblPerformance, Gene, iActiveGenes, iGeneIndex, and intLength.
Referenced by GarpAlgorithm::_setConfiguration().
bool Rule::similar | ( | Rule * | objOtherRule | ) | [virtual] |
Reimplemented in LogitRule.
Definition at line 349 of file Rule.cpp.
References Gene, iActiveGenes, iGeneIndex, intLength, and type().
Referenced by GarpAlgorithm::concatenateRuleSets(), and GarpAlgorithm::saveRule().
double Rule::testWithData | ( | EnvCellSet * | objTrainSet | ) |
Definition at line 387 of file Rule.cpp.
References _dA, _dSig, _no, _pXYs, dblPerformance, EnvCellSet::get(), getCertainty(), getError(), getStrength(), MIN_SIG_NO, GarpUtil::randint(), and EnvCellSet::size().
Referenced by GarpAlgorithm::evaluate().
char * Rule::toString | ( | ) | [virtual] |
char * Rule::toXML | ( | ) | [virtual] |
Definition at line 254 of file Rule.cpp.
References dblPerformance, Gene, intLength, iOrigGen, lId, and type().
Referenced by RuleSet::toXML().
virtual char Rule::type | ( | ) | const [inline, virtual] |
Reimplemented in LogitRule, AtomicRule, NegatedRangeRule, GarpRule, RangeRule, GarpRule, RangeRule, NegatedRangeRule, and LogitRule.
Definition at line 88 of file Rule.h.
Referenced by GarpAlgorithm::_getConfiguration(), GarpAlgorithm::concatenateRuleSets(), copy(), RuleSet::gatherRuleSetStats(), initialize(), log(), mutate(), GarpAlgorithm::saveRule(), similar(), toString(), and toXML().
friend class CJobResultValidator [friend] |
friend class GarpAlgorithm [friend] |
double Rule::_dA [protected] |
double Rule::_dSig [protected] |
int Rule::_no [protected] |
double Rule::_pXYs [protected] |
bool* Rule::bGeneIsActive [protected] |
Definition at line 71 of file Rule.h.
Referenced by clone(), copy(), initialize(), Rule(), and RuleSet::setActiveGenes().
bool Rule::blnNeedsEvaluation [protected] |
Definition at line 52 of file Rule.h.
Referenced by clone(), copy(), GarpAlgorithm::crossover(), GarpAlgorithm::evaluate(), initialize(), GarpAlgorithm::join(), mutate(), LogitRule::mutate(), needsEvaluation(), Rule(), and GarpAlgorithm::select().
char Rule::chrOrigin [protected] |
Definition at line 60 of file Rule.h.
Referenced by clone(), copy(), GarpAlgorithm::crossover(), initialize(), GarpAlgorithm::join(), mutate(), LogitRule::mutate(), Rule(), and GarpAlgorithm::saveRule().
char Rule::chrPad [protected] |
double Rule::dblPerformance[10] [protected] |
Vector for storing the performance values for the rule.
Definition at line 51 of file Rule.h.
Referenced by GarpAlgorithm::_getConfiguration(), RuleSet::applyRulesToCell(), clone(), copy(), RuleSet::gatherRuleSetStats(), RuleSet::getOveralPerformance(), log(), GarpAlgorithm::measure(), RestoreRule(), Rule(), GarpAlgorithm::saveRule(), GarpAlgorithm::select(), testWithData(), toString(), and toXML().
BYTE* Rule::Gene [protected] |
BYTE vector containing the genes (representation of the variables in a Genetic Algorithm.
Definition at line 46 of file Rule.h.
Referenced by GarpAlgorithm::_getConfiguration(), RuleSet::applyRulesToCell(), RangeRule::applyToCell(), NegatedRangeRule::applyToCell(), AtomicRule::applyToCell(), RangeRule::bioclimRange(), clone(), copy(), GarpAlgorithm::crossover(), RuleSet::gatherRuleSetStats(), getCertainty(), RangeRule::getStrength(), AtomicRule::getStrength(), LogitRule::getStrength(), RuleSet::getValue(), initialize(), RangeRule::initialize(), AtomicRule::initialize(), LogitRule::initialize(), GarpAlgorithm::join(), log(), mutate(), LogitRule::mutate(), RestoreRule(), Rule(), similar(), LogitRule::similar(), toString(), toXML(), RuleSet::verify(), and ~Rule().
int Rule::iActiveGenes [protected] |
Definition at line 73 of file Rule.h.
Referenced by RangeRule::applyToCell(), NegatedRangeRule::applyToCell(), AtomicRule::applyToCell(), clone(), copy(), RangeRule::getStrength(), AtomicRule::getStrength(), LogitRule::getStrength(), initialize(), RangeRule::initialize(), AtomicRule::initialize(), LogitRule::initialize(), mutate(), LogitRule::mutate(), RestoreRule(), Rule(), RuleSet::setActiveGenes(), and similar().
int* Rule::iGeneIndex [protected] |
Definition at line 72 of file Rule.h.
Referenced by RangeRule::applyToCell(), NegatedRangeRule::applyToCell(), AtomicRule::applyToCell(), clone(), copy(), RangeRule::getStrength(), AtomicRule::getStrength(), LogitRule::getStrength(), initialize(), RangeRule::initialize(), AtomicRule::initialize(), LogitRule::initialize(), mutate(), LogitRule::mutate(), RestoreRule(), Rule(), RuleSet::setActiveGenes(), and similar().
int Rule::intConclusion [protected] |
Definition at line 59 of file Rule.h.
Referenced by initialize(), and Rule().
int Rule::intGenes [protected] |
Number of genes stored by the rule.
Definition at line 48 of file Rule.h.
Referenced by clone(), copy(), initialize(), log(), Rule(), and GarpAlgorithm::saveRule().
int Rule::intGens [protected] |
Definition at line 53 of file Rule.h.
Referenced by clone(), copy(), GarpAlgorithm::crossover(), GarpAlgorithm::evaluate(), initialize(), GarpAlgorithm::join(), mutate(), LogitRule::mutate(), and Rule().
int Rule::intLength [protected] |
Definition at line 57 of file Rule.h.
Referenced by GarpAlgorithm::_getConfiguration(), NegatedRangeRule::applyToCell(), clone(), copy(), GarpAlgorithm::crossover(), RangeRule::getStrength(), LogitRule::getStrength(), initialize(), RangeRule::initialize(), AtomicRule::initialize(), GarpAlgorithm::join(), mutate(), LogitRule::mutate(), RestoreRule(), Rule(), similar(), LogitRule::similar(), toString(), and toXML().
int Rule::intNumber [protected] |
int Rule::intScreen [protected] |
int Rule::intScreener [protected] |
int Rule::intTrials [protected] |
Definition at line 54 of file Rule.h.
Referenced by clone(), copy(), GarpAlgorithm::evaluate(), initialize(), Rule(), and GarpAlgorithm::saveRule().
int Rule::iOrigGen [protected] |
int Rule::lId [protected] |