openModeller  Version 1.5.0
Rule Class Referenceabstract

#include <Rule.h>

Inheritance diagram for Rule:
Inheritance graph
Collaboration diagram for Rule:
Collaboration graph

Public Member Functions

 Rule ()
 Default constructor. More...
 
virtual ~Rule ()
 Default destructor. More...
 
virtual RuleobjFactory ()=0
 
virtual Ruleclone ()
 
virtual void copy (Rule *fromRule)
 
void RestoreRule (double *perf, unsigned char *genes, int arry_len, int *gene_index)
 Restore Model. More...
 
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

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
 

Friends

class RuleSet
 
class GarpAlgorithm
 
class CJobResultValidator
 

Detailed Description

Abstract class for all rule types supported by Garp

Definition at line 37 of file Rule.h.

Constructor & Destructor Documentation

Rule::~Rule ( )
virtual

Default destructor.

Definition at line 66 of file Rule.cpp.

References Gene.

Member Function Documentation

virtual bool Rule::applyToCell ( EnvCell cell)
pure virtual
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().

Here is the call graph for this function:

virtual void Rule::fromString ( char *  strRule)
pure virtual
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

Definition at line 309 of file Rule.cpp.

References EnvCell::values.

Referenced by testWithData().

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
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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

char * Rule::toString ( )
virtual

Definition at line 224 of file Rule.cpp.

References dblPerformance, Gene, intLength, and type().

Here is the call graph for this function:

char * Rule::toXML ( )
virtual

Definition at line 254 of file Rule.cpp.

References dblPerformance, Gene, intLength, iOrigGen, lId, and type().

Referenced by RuleSet::toXML().

Here is the call graph for this function:

Friends And Related Function Documentation

friend class CJobResultValidator
friend

Definition at line 42 of file Rule.h.

friend class GarpAlgorithm
friend

Definition at line 41 of file Rule.h.

friend class RuleSet
friend

Definition at line 40 of file Rule.h.

Member Data Documentation

double Rule::_dA
protected

Definition at line 67 of file Rule.h.

Referenced by clone(), copy(), Rule(), and testWithData().

double Rule::_dSig
protected

Definition at line 68 of file Rule.h.

Referenced by clone(), copy(), Rule(), and testWithData().

int Rule::_no
protected

Definition at line 66 of file Rule.h.

Referenced by clone(), copy(), Rule(), and testWithData().

double Rule::_pXYs
protected

Definition at line 65 of file Rule.h.

Referenced by clone(), copy(), Rule(), and testWithData().

bool* Rule::bGeneIsActive
protected

Definition at line 71 of file Rule.h.

Referenced by clone(), copy(), initialize(), Rule(), and RuleSet::setActiveGenes().

char Rule::chrOrigin
protected
char Rule::chrPad
protected

Definition at line 61 of file Rule.h.

Referenced by clone(), copy(), initialize(), and Rule().

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
int Rule::intNumber
protected

Definition at line 58 of file Rule.h.

Referenced by Rule().

int Rule::intScreen
protected

Definition at line 56 of file Rule.h.

Referenced by clone(), copy(), initialize(), and Rule().

int Rule::intScreener
protected

Definition at line 55 of file Rule.h.

Referenced by clone(), copy(), and Rule().

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

Definition at line 63 of file Rule.h.

Referenced by clone(), GarpAlgorithm::colonize(), copy(), Rule(), and toXML().

int Rule::lId
protected

Definition at line 62 of file Rule.h.

Referenced by clone(), GarpAlgorithm::colonize(), copy(), Rule(), and toXML().


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