#include <D:/Temp/vs/gal/source/SingleValueChromosome.h>
Inherits Chromosome::Representation::GaDomainChromosome< TYPE >, and Chromosome::Representation::GaMutableCode.
Inherited by Chromosome::Representation::GaSVArithmeticChromosome< TYPE >.
Public Member Functions | |
virtual void GACALL | Flip (int start, int size) |
More details are given in specification of GaMutableCode::Flip method. | |
virtual void GACALL | Invert (int start, int size) |
More details are given in specification of GaMutableCode::Invert method. | |
GaSingleValueChromosome (TYPE value, GaChromosomeDomainBlock< TYPE > *configBlock) | |
This constructor initializes chromosome with CCB and its code. | |
GaSingleValueChromosome (GaChromosomeDomainBlock< TYPE > *configBlock) | |
This constructor initializes chromosome with CCB and randomly generated code. | |
GaSingleValueChromosome (const GaSingleValueChromosome< TYPE > &c, bool setupOnly) | |
This is copy constructor. | |
virtual GaChromosomePtr GACALL | MakeCopy (bool setupOnly) const |
More details are given in specification of GaChromosome::MakeCopy method. | |
virtual GaChromosomePtr GACALL | MakeNewFromPrototype () const |
This method uses MakeCopy method to create chromosome's object, so if additional steps are not needed for creating chromosome from prototype, classes which inherits this class don't have to override this method. | |
virtual int GACALL | GetCodeSize () const |
This method is not thread-safe. | |
TYPE GACALL | GetValue () const |
This method is not thread-safe. | |
void GACALL | SetValue (TYPE value) |
SetValue method sets value which represents chromosome's code. | |
virtual GaChromosome &GACALL | operator= (const GaChromosome &rhs) |
More details are given in specification of GaChromosome::operator =. | |
virtual float GACALL | operator== (const GaChromosome &c) const |
More details are given in specification of GaChromosome::operator ==. | |
Protected Member Functions | |
virtual void GACALL | PreapareForMutation () |
PreapareForMutation method saves backup of chromosome's code. It overwrite previous backup. | |
virtual void GACALL | AcceptMutation () |
This method overrides abstract method of GaChromosome class, and has no functionality. | |
virtual void GACALL | RejectMutation () |
RejectMutation method restores chromosome's code from backup. | |
Protected Attributes | |
TYPE | _value |
Chromosome's code. | |
TYPE | _backup |
Backup copy chromosome's code before mutation if improving-only mutation flag is set in chromosome's parameters. |
This class has no built-in synchronizator, so LOCK_OBJECT
and LOCK_THIS_OBJECT
macros cannot be used with instances of this class. No public or private methods are thread-safe.
TYPE | type of value in chromosome's code. |
Chromosome::Representation::GaSingleValueChromosome< TYPE >::GaSingleValueChromosome | ( | TYPE | value, | |
GaChromosomeDomainBlock< TYPE > * | configBlock | |||
) | [inline] |
This constructor initializes chromosome with CCB and its code.
value | chromosome's code. | |
configBlock | pointer to CCB. |
Chromosome::Representation::GaSingleValueChromosome< TYPE >::GaSingleValueChromosome | ( | GaChromosomeDomainBlock< TYPE > * | configBlock | ) | [inline] |
This constructor initializes chromosome with CCB and randomly generated code.
configBlock | pointer to CCB. |
Chromosome::Representation::GaSingleValueChromosome< TYPE >::GaSingleValueChromosome | ( | const GaSingleValueChromosome< TYPE > & | c, | |
bool | setupOnly | |||
) | [inline] |
This is copy constructor.
c | reference to chromosome which is copied. | |
setupOnly | if this parameter is true , only pointer to CCB is copied. If this parameter is false , chromosome's data and CCB is copied. |
virtual void GACALL Chromosome::Representation::GaSingleValueChromosome< TYPE >::Flip | ( | int | start, | |
int | size | |||
) | [inline, virtual] |
More details are given in specification of GaMutableCode::Flip method.
This method is not thread-safe.
start | parameter is ignored. | |
size | parameter is ignored. |
Implements Chromosome::Representation::GaMutableCode.
virtual void GACALL Chromosome::Representation::GaSingleValueChromosome< TYPE >::Invert | ( | int | start, | |
int | size | |||
) | [inline, virtual] |
More details are given in specification of GaMutableCode::Invert method.
This method is not thread-safe.
start | parameter is ignored. | |
size | parameter is ignored. |
Implements Chromosome::Representation::GaMutableCode.
virtual GaChromosomePtr GACALL Chromosome::Representation::GaSingleValueChromosome< TYPE >::MakeCopy | ( | bool | setupOnly | ) | const [inline, virtual] |
More details are given in specification of GaChromosome::MakeCopy method.
This method is not thread-safe.
Implements Chromosome::GaChromosome.
Reimplemented in Chromosome::Representation::GaSVArithmeticChromosome< TYPE >.
virtual GaChromosomePtr GACALL Chromosome::Representation::GaSingleValueChromosome< TYPE >::MakeNewFromPrototype | ( | ) | const [inline, virtual] |
This method uses MakeCopy method to create chromosome's object, so if additional steps are not needed for creating chromosome from prototype, classes which inherits this class don't have to override this method.
More details are given in specification of GaChromosome::MakeNewFromPrototype method.
Implements Chromosome::GaChromosome.
virtual int GACALL Chromosome::Representation::GaSingleValueChromosome< TYPE >::GetCodeSize | ( | ) | const [inline, virtual] |
This method is not thread-safe.
Implements Chromosome::GaChromosome.
TYPE GACALL Chromosome::Representation::GaSingleValueChromosome< TYPE >::GetValue | ( | ) | const [inline] |
This method is not thread-safe.
void GACALL Chromosome::Representation::GaSingleValueChromosome< TYPE >::SetValue | ( | TYPE | value | ) | [inline] |
SetValue
method sets value which represents chromosome's code.
This method is not thread-safe.
value | new value of chromosome's code. |
virtual GaChromosome& GACALL Chromosome::Representation::GaSingleValueChromosome< TYPE >::operator= | ( | const GaChromosome & | rhs | ) | [inline, virtual] |
More details are given in specification of GaChromosome::operator =.
This method is not thread-safe.
Reimplemented from Chromosome::GaDefaultChromosome.
virtual float GACALL Chromosome::Representation::GaSingleValueChromosome< TYPE >::operator== | ( | const GaChromosome & | c | ) | const [inline, virtual] |
More details are given in specification of GaChromosome::operator ==.
This method is not thread-safe.
Implements Chromosome::GaChromosome.
virtual void GACALL Chromosome::Representation::GaSingleValueChromosome< TYPE >::PreapareForMutation | ( | ) | [inline, protected, virtual] |
PreapareForMutation
method saves backup of chromosome's code. It overwrite previous backup.
Implements Chromosome::GaDefaultChromosome.
virtual void GACALL Chromosome::Representation::GaSingleValueChromosome< TYPE >::AcceptMutation | ( | ) | [inline, protected, virtual] |
This method overrides abstract method of GaChromosome class, and has no functionality.
Implements Chromosome::GaDefaultChromosome.
virtual void GACALL Chromosome::Representation::GaSingleValueChromosome< TYPE >::RejectMutation | ( | ) | [inline, protected, virtual] |
RejectMutation
method restores chromosome's code from backup.
Implements Chromosome::GaDefaultChromosome.
TYPE Chromosome::Representation::GaSingleValueChromosome< TYPE >::_value [protected] |
Chromosome's code.
TYPE Chromosome::Representation::GaSingleValueChromosome< TYPE >::_backup [protected] |
Backup copy chromosome's code before mutation if improving-only mutation flag is set in chromosome's parameters.