Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

IntGene Class Reference

Integer (or multivalue) gene with independent values. More...

#include <genes.h>

Inheritance diagram for IntGene:

AnyIntGene Gene Genstruct List of all members.

Public Methods

 IntGene ()
virtual IntGene & set (int val)
virtual int getvalue () const
virtual void init ()
virtual bool pointMutate (const MutationRate &k)
virtual double equality (const Genstruct &other) const
virtual void copy (const Genstruct &other)
virtual Genstructreplicate () const
virtual void print (TextOStream &out) const
virtual void check () const

Detailed Description

Integer (or multivalue) gene with independent values.

This is the integer equivalent of the FloatGene. The gaussian mutation method may not suit this data type so well, but... that's only life.

Definition at line 601 of file genes.h.


Constructor & Destructor Documentation

IntGene   [inline]
 

Default constructor, FORBIDDEN! Exists only because of RTTI system.

Definition at line 608 of file genes.h.

Referenced by replicate().


Member Function Documentation

void check   const [virtual]
 

Standard check operator.

Implementation for Object.

Exceptions:
assertion_failed  check_failed

Reimplemented from AnyIntGene.

Definition at line 423 of file genes.cc.

References AnyIntGene::check(), AnyIntGene::mMax, and AnyIntGene::mMin.

void copy const Genstruct   other [virtual]
 

Standard copy operator.

Implementation for Genstruct.

Reimplemented from AnyIntGene.

Definition at line 385 of file genes.cc.

References AnyIntGene::copy().

double equality const Genstruct   other const [virtual]
 

Implementation for Genstruct.

The distance measure for two integer genes is 0.0 if they are equal, and 1.0 if they are different.

Reimplemented from Genstruct.

Definition at line 414 of file genes.cc.

References AnyIntGene::mMax, and AnyIntGene::mMin.

int getvalue   [virtual]
 

Implementation for AnyIntGene.

Returns:
The decoded phenotypic value of the gene.

Reimplemented from AnyIntGene.

Definition at line 377 of file genes.cc.

void init   [virtual]
 

This implementation initializes the gene into any value with equal probability.

Reimplemented from Genstruct.

Definition at line 381 of file genes.cc.

References AnyIntGene::mMax, and AnyIntGene::mMin.

Referenced by pointMutate().

bool pointMutate const MutationRate   k [virtual]
 

Implementation for Genstruct.

If the mutation actualizes, it mutates the integer gene into any other value with uniform probability.

Returns:
If a mutation really actualized or not.

Reimplemented from Genstruct.

Definition at line 397 of file genes.cc.

References MutationRate::doubleVariance(), init(), MutationRate::intRate(), AnyIntGene::mMax, and Gene::mutability.

void print TextOStream &    out const [virtual]
 

Recursively prints the genome to the given stream.

This is most cool.

Reimplemented from Genstruct.

Definition at line 419 of file genes.cc.

References Genstruct::id.

virtual Genstruct* replicate   const [inline, virtual]
 

Clones a copy of self, RECURSIVELY.

It's funny how simple reproduction is nowadays.

Reimplemented from Genstruct.

Definition at line 644 of file genes.h.

References IntGene().

virtual IntGene& set int    val [inline, virtual]
 

Sets the value of the gene.

Definition at line 615 of file genes.h.


The documentation for this class was generated from the following files:
Generated on Thu Feb 10 20:12:01 2005 for NeHeP by doxygen1.2.18