In file code/C/model.H:

class GModel : public GObject

Virtual class that defines the interface to derived models

Inheritance:


public members:

GModel()
virtual ~GModel()
virtual int Evaluate( GOperator *head)
Evaluate an operator (called by GProgram)
GOperator *head
The head of the operator tree to be evaluated
virtual GType *Evaluate( oper_enum operation, GArray < GType > &params, int node)
This actually does the dirty work in the evaluation
oper_enum operation
The operation to evaluate
GArray < GType > &params
The arguments to the operator (these must be fully evaluated)
virtual int GetNext( oper_enum operation, int last, GType *retval)
return the next child to evaluate, or 0 when done
oper_enum operation
The operation being evaluated
int last
The last child that was evaluated or -1 if the first pass
GType *retval
The returned value of the last child or NULL if the first pass
virtual GFitness GetFitness()
returns the fitness for the last run
virtual int Running()
returns true if the tree should keep running

Inherited from GObject:

public members:

friend ostream& operator<<(ostream& s, GObject &)

Documentation

If a new model complies with this interface then it will be able to be evaluated by the existing code. The other piece of code that needs to be added for a new model are the type definitions, and operator specifications. Finally the models will have to be created and added in the users main function (or they can modify the existing one.)
virtual int GetNext ( oper_enum operation, int last, GType *retval)
This allows for generality in the conditional operators. Based upon the return value of the previous sub-tree, the index to the previous sub-tree, and the operator this function must return the index of the next child to evaluate, or zero when the evalution is complete.

virtual GFitness GetFitness ()
This must return the fitness of the program


direct child classes: GDistNetModel

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling