• Main Page
  • Namespaces
  • Classes
  • Files
  • Class List
  • Class Hierarchy
  • Class Members

IntegerGene Class Reference

Class representing an integer gene.

#include <IntegerGene.h>

Inheritance diagram for IntegerGene:

Gene List of all members.

Public Member Functions

 IntegerGene (Random *random)
 Constructor.
 IntegerGene (int lowerBound, int upperBound, Random *random)
 Constructor.
 IntegerGene (IntegerGene &integerGene)
 Copy constructor.
 IntegerGene (IntegerGene *integerGene)
 Copy constructor.
 ~IntegerGene ()
 Destructor rnd Destructor of the class.
int randomMutation (double mutationProbability)
int polynomialMutation (double mutationProbability, double distributionIndex)
int uniformMutation (double mutationProbability, double perturbation)
double getRealAllele ()
void setRealAllele (double value)
void writeGenotype (ofstream &outputFile)
void printGenotype ()
IntegerGene & operator= (const IntegerGene &integerGene)
bool operator== (const IntegerGene &integerGene)
bool operator!= (const IntegerGene &integerGene)

Public Attributes

int allele_
 Allele.
int lowerBound_
 Lower bound of the allele.
int upperBound_
 Upper bound of the allele.

Friends

ostream & operator<< (ostream &outputStream, IntegerGene &gene)

Detailed Description

Definition at line 19 of file IntegerGene.h.


Constructor & Destructor Documentation

IntegerGene::IntegerGene (  Random *  random  ) 
 

Parameters:
random Pointer to the random number generator
Constructor of the class

Definition at line 18 of file IntegerGene.cpp.

References allele_, lowerBound_, MAX_INT, MIN_INT, Gene::random_, Random::rndreal(), and upperBound_.

IntegerGene::IntegerGene (  int  lowerBound,
int  upperBound,
Random *  random
) 
 

Parameters:
lowerBound Lower limit of the gene value
upperBound Upper limit of the gene value
random Pointer to the random number generator
Constructor of the class

Definition at line 36 of file IntegerGene.cpp.

References allele_, lowerBound_, Gene::random_, Random::rndreal(), and upperBound_.

IntegerGene::IntegerGene (  IntegerGene &  integerGene  ) 
 

Parameters:
integerGene The gene to copy
Constructor of the class

Definition at line 53 of file IntegerGene.cpp.

References allele_, lowerBound_, and upperBound_.

IntegerGene::IntegerGene (  IntegerGene *  integerGene  ) 
 

Parameters:
integerGene The gene to copy
Constructor of the class

Definition at line 69 of file IntegerGene.cpp.

References allele_, lowerBound_, and upperBound_.

IntegerGene::~IntegerGene (   ) 
 

Definition at line 84 of file IntegerGene.cpp.


Member Function Documentation

double IntegerGene::getRealAllele (   )  [virtual]
 

Reimplemented from Gene.

Definition at line 179 of file IntegerGene.cpp.

References allele_.

bool IntegerGene::operator!= (  const IntegerGene &  integerGene  ) 
 

Definition at line 208 of file IntegerGene.cpp.

References allele_.

IntegerGene & IntegerGene::operator= (  const IntegerGene &  integerGene  ) 
 

Definition at line 195 of file IntegerGene.cpp.

References allele_.

bool IntegerGene::operator== (  const IntegerGene &  integerGene  ) 
 

Definition at line 201 of file IntegerGene.cpp.

References allele_.

int IntegerGene::polynomialMutation (  double  mutationProbability,
double  distributionIndex
)  [virtual]
 

Reimplemented from Gene.

Definition at line 104 of file IntegerGene.cpp.

References allele_, lowerBound_, Gene::random_, Random::rndreal(), and upperBound_.

void IntegerGene::printGenotype (   )  [virtual]
 

Implements Gene.

Definition at line 191 of file IntegerGene.cpp.

References allele_.

int IntegerGene::randomMutation (  double  mutationProbability  )  [virtual]
 

Reimplemented from Gene.

Definition at line 87 of file IntegerGene.cpp.

References allele_, lowerBound_, Gene::random_, Random::rnd(), Random::rndreal(), and upperBound_.

void IntegerGene::setRealAllele (  double  value  )  [virtual]
 

Reimplemented from Gene.

Definition at line 183 of file IntegerGene.cpp.

References allele_.

int IntegerGene::uniformMutation (  double  mutationProbability,
double  perturbation
)  [virtual]
 

Reimplemented from Gene.

Definition at line 152 of file IntegerGene.cpp.

References allele_, lowerBound_, Gene::random_, Random::rndreal(), and upperBound_.

void IntegerGene::writeGenotype (  ofstream &  outputFile  )  [virtual]
 

Implements Gene.

Definition at line 187 of file IntegerGene.cpp.

References allele_.


Friends And Related Function Documentation

ostream& operator<< (  ostream &  outputStream,
IntegerGene &  gene
)  [friend]
 

Definition at line 215 of file IntegerGene.cpp.


Member Data Documentation

int IntegerGene::allele_
 

Definition at line 21 of file IntegerGene.h.

Referenced by getRealAllele(), IntegerGene(), operator!=(), operator<<(), operator=(), operator==(), polynomialMutation(), printGenotype(), randomMutation(), setRealAllele(), uniformMutation(), and writeGenotype().

int IntegerGene::lowerBound_
 

Definition at line 22 of file IntegerGene.h.

Referenced by IntegerGene(), polynomialMutation(), randomMutation(), and uniformMutation().

int IntegerGene::upperBound_
 

Definition at line 23 of file IntegerGene.h.

Referenced by IntegerGene(), polynomialMutation(), randomMutation(), and uniformMutation().


The documentation for this class was generated from the following files:
  • IntegerGene.h
  • IntegerGene.cpp

Our Software

orangebox Mallba

orangebox ssGA

orangebox JGDS

orangebox xxGA

orangebox JCell

orangebox MHTB

orangebox DEME

orangebox JMetal

orangebox More...

orangebox Go Back