8typedef boost::shared_ptr<CrossoverOp> CrossoverOpP;
10typedef boost::shared_ptr<MutationOp> MutationOpP;
14typedef boost::shared_ptr<State> StateP;
54 std::vector<CrossoverOpP> empty;
61 std::vector<MutationOpP> empty;
77 virtual void read(XMLNode&) = 0;
80 virtual void write(XMLNode&) = 0;
82 virtual uint getGenomeSize()
102 char *s = xGene.createXMLString();
112typedef boost::shared_ptr<Genotype> GenotypeP;
voidP getParameterValue(StateP state, std::string name)
Read single parameter value from Registry.
virtual void registerParameters(StateP)
Register genotype's parameters (called before Genotype::initialize)
std::string getName()
Return genotype's name (each genotype is uniquely identified with its name).
uint getGenotypeId()
Return this genotype's index in individual structure.
virtual std::vector< MutationOpP > getMutationOp()
Create and return a vector of mutation operators.
virtual bool initialize(StateP state)=0
Initialize a genotype object (read parameters, perform sanity check, build data)
virtual std::vector< CrossoverOpP > getCrossoverOp()
Create and return a vector of crossover operators.
bool registerParameter(StateP state, std::string name, voidP value, enum ECF::type T, std::string description="")
Register a single parameter.
virtual void write(XMLNode &)=0
Write genotype data to XMLNode.
std::string name_
genotype's name
bool isParameterDefined(StateP state, std::string name)
Check if parameter is defined in the configuration.
uint genotypeId_
this genotype's unique index in individual structure
void setGenotypeId(uint id)
Set genotype index in an individual.
virtual Genotype * copy()=0
Create an identical copy of the genotype object.
std::string toString()
Output genotype to string.
virtual void read(XMLNode &)=0
Read genotype data from XMLNode.
bool setParameterValue(StateP state, std::string name, voidP value)
Write single parameter value to Registry.
State class - backbone of the framework.
type
Data types used for configuration file parameters.