#include <cOperatorFitnessAlgorithmBasic.h>
List of all members.
Detailed Description
Constructor & Destructor Documentation
enviroment::cOperatorFitnessAlgorithmBasic::cOperatorFitnessAlgorithmBasic |
( |
double |
dInFaktorAllFitnessPart = 0.5 , |
|
|
double |
dInFaktorPositivFitnessPart = 0.5 , |
|
|
const string |
szOldOperationDataPath = "" |
|
) |
| |
Constructor of the class cOperatorFitnessAlgorithmBasic.
- Parameters:
-
dInFaktorAllFitnessPart | the factor A for the whool fitness |
dInFaktorPositivFitnessPart | the factor B for the increased fitnesssum |
szOldOperationDataPath | the path wher the operator fitness data is stored; if "" (standardvalue) the path is "./cOperatorFitnessAlgorithmBasic.xml"; if the path ends with an '/', it is a folder in which the the operator fitness data should be stored into an file with the name "cOperatorFitnessAlgorithmBasic.xml" |
virtual enviroment::cOperatorFitnessAlgorithmBasic::~cOperatorFitnessAlgorithmBasic |
( |
| ) |
|
|
virtual |
Member Function Documentation
virtual double enviroment::cOperatorFitnessAlgorithmBasic::evalueFitness |
( |
const cOperation & |
operation, |
|
|
const list< cIndividualInfo > & |
liCreatedIndividualInfos |
|
) |
| |
|
virtual |
This method evalues the fitness of the given operator operation new.
- Parameters:
-
operation | the operator for which the fitness is to be evalued new |
liCreatedIndividualInfos | a list with all informations about all individuals the operator has created |
- Returns:
- the new evalued fitness of the operation
Implements enviroment::cOperatorFitnessAlgorithm.
virtual string enviroment::cOperatorFitnessAlgorithmBasic::getClassName |
( |
| ) |
const |
|
virtual |
double enviroment::cOperatorFitnessAlgorithmBasic::getFaktorAllFitnessPart |
( |
| ) |
const |
double enviroment::cOperatorFitnessAlgorithmBasic::getFaktorPositivFitnessPart |
( |
| ) |
const |
virtual double enviroment::cOperatorFitnessAlgorithmBasic::getFitness |
( |
const cOperation & |
operation | ) |
|
|
virtual |
This method returns the fitness of the given operator operation.
- Parameters:
-
operation | the operator for which the fitness is to be returned |
- Returns:
- the fitness of the operation
Implements enviroment::cOperatorFitnessAlgorithm.
virtual list< pair< const cOperation*, double > > enviroment::cOperatorFitnessAlgorithmBasic::getFitness |
( |
| ) |
|
|
virtual |
virtual double enviroment::cOperatorFitnessAlgorithmBasic::getFitnessSum |
( |
| ) |
const |
|
virtual |
virtual double enviroment::cOperatorFitnessAlgorithmBasic::getMinFitness |
( |
| ) |
const |
|
virtual |
double enviroment::cOperatorFitnessAlgorithmBasic::normalizeIndividualFitness |
( |
double |
dFitness, |
|
|
double |
dMinFitness = 0.0 |
|
) |
| const |
|
protected |
it's greater 1: N( dFitness ) = max( 1 , ( dFitness - dMinFitness ) )
- Parameters:
-
dFitness | the fitnessvalue of an individual to normalize |
dMinFitness | the minimal fitness; evalue with cObjectFitnessAlgorithm->getWorstCaseFitness()->getFitness() |
- Returns:
- the normalized individual fitness
map< string, cOperatorFitness > enviroment::cOperatorFitnessAlgorithmBasic::restoreXmlOperatorData |
( |
istream & |
iStream, |
|
|
int & |
outStatus |
|
) |
| const |
|
protected |
This function restores the operator fitness data from the given stream. In the stream the operator fitness data should be writen in the xml -format, like storeXmlOperationsData() stores it.
- See also:
- storeXmlOperationsData()
- Parameters:
-
iStream | the stream where the operator fitness data is stored in |
outStatus | An reverence to an integervalue where the errorvalue can be stored to. possible errorvalues are:
- 0 loading successful
- -1 loading error, invalid stream
- -2 loading error, invalid data in stream
- 1 loading warning, invalid data in stream, error could be corrected
- 2 loading warning, invalid data in stream, maybe the loaded data is wrong
|
- Returns:
- the restored operator fitness data
map< string, cOperatorFitness > enviroment::cOperatorFitnessAlgorithmBasic::restoreXmlOperatorData |
( |
const TiXmlNode * |
pXmlNode, |
|
|
int & |
outStatus |
|
) |
| const |
|
protected |
This function restores the operator fitness data from the given TinyXml node. In the TinyXml node the operator fitness data should be stored in the xml -format, like storeXmlOperationsData() stores it.
- See also:
- storeXmlOperationsData()
- Parameters:
-
pXmlNode | a pointer to the TinyXml node the operator fitness data is stored in |
outStatus | An reverence to an integervalue where the errorvalue can be stored to. possible errorvalues are:
- 0 loading successful
- -1 loading error, invalid stream
- -2 loading error, invalid data in stream
- 1 loading warning, invalid data in stream, error could be corrected
- 2 loading warning, invalid data in stream, maybe the loaded data is wrong
|
- Returns:
- the restored operator fitness data
bool enviroment::cOperatorFitnessAlgorithmBasic::storeXmlOperationsData |
( |
ostream & |
oStream, |
|
|
const map< string, cOperatorFitness > & |
mapOperationFitness |
|
) |
| const |
|
protected |
This function stores the operator fitness data in xml -format into the given stream.
Example Xml -structur: <operatorFitness algorithm="cOperatorFitnessAlgorithmBasic"> <operator name="operator1" b_ins="1" a_ins="100" f_ins="0.01" a_p="10" f_p="0.1"> <operator name="operator2" b_ins="2" a_ins="100" f_ins="0.02" a_p="5" f_p="0.4"> <operatorFitness>
- See also:
- restoreXmlOperationsData()
- Parameters:
-
oStream | the stream wher the operator data is to store to |
mapOperationFitness | the operator fitness data to store |
- Returns:
- true if this operation fitness data is stored, else false
virtual double enviroment::cOperatorFitnessAlgorithmBasic::updateFitness |
( |
const cOperation & |
operation, |
|
|
const cIndividualInfo & |
createdIndividualInfo |
|
) |
| |
|
virtual |
This method updates the fitness of the given operator operation. For this update the information this cOperatorFitnessAlgorithmBasic object knows about the operator and the given createdIndividualInfo is considered to evalue the new fitness.
- Parameters:
-
operation | the operator, for which the fitness is to be updated |
createdIndividualInfo | the information about an individual the operator has created and which is not jet known by this cOperatorFitnessAlgorithmBasic object |
- Returns:
- the new evalued fitness of the operation
Implements enviroment::cOperatorFitnessAlgorithm.
virtual double enviroment::cOperatorFitnessAlgorithmBasic::updateFitness |
( |
const cOperation & |
operation, |
|
|
const list< cIndividualInfo > & |
liCreatedIndividualInfos |
|
) |
| |
|
virtual |
This method updates the fitness of the given operator operation. For this update the information this cOperatorFitnessAlgorithmBasic object knows about the operator and the given information in liCreatedIndividualInfos is considered to evalue the new fitness.
- Parameters:
-
operation | the operator, for which the fitness is to be updated |
liCreatedIndividualInfos | a list with the information about the individuals the operator has created and which are not jet known by this cOperatorFitnessAlgorithmBasic object |
- Returns:
- the new evalued fitness of the operation
Implements enviroment::cOperatorFitnessAlgorithm.
cOperatorFitness enviroment::cOperatorFitnessAlgorithmBasic::updateFitness |
( |
const cOperatorFitness & |
opFitness, |
|
|
const list< cIndividualInfo > & |
liCreatedIndividualInfos |
|
) |
| const |
|
protected |
This function reevalues operation fitness opFitness with the values of liCreatedIndividualInfos.
Important values evalued internal:
- V_i: The improvement which the operation has created with an individual from the list liCreatedIndividualInfos. This is the ratio of the normalized fitness F_N of the created individual diveded by the best fitness F_B of a individual at the creation time. V_i = NF( F_N ) / NF( F_B )
Values of opFitness reevalued:
- dB_ins: The sum of all fitnessimprovments the operator has created. For every V_i value which is greater 1, the values (V_i - 1) are added to the old opFitness.dB_ins value.
- dA_ins: The cost sum the operator has needed. This is the sum of all cost (evalued with the benchmark value) from the list liCreatedIndividualInfos added to the opFitness.dA_ins value.
- dF_ins: The whool fitness. This is the ratio of the sum of all fitnessimprovments B_ins diveded by cost sum the operation has needed A_ins. dF_ins = dB_ins / dA_ins
- dA_p: The cost sum the operator has needed for improvments. This is the sum of all cost (evalued with the benchmark value) operations have needed for generating a improved individual (an individual which is better as the best individual in the algorithm, tihs means which V_i is greater 1) from the list liCreatedIndividualInfos added to the opFitness.dA_p value.
- dF_p: The improvment fitness. This is the ratio of the sum of all fitnessimprovments B_ins diveded by cost sum the operator has needed for inprovments A_P. dF_p = dB_ins / dA_p
- dF: The fitness of the operator. This is the sum combination of the whool fitness F_ins multiplyed by the weight factor A and the improvment fitness F_P multiplyed by the weight factor B. F = A * dF_ins + B * dF_p
- See also:
- cOperatorFitness
-
normalizeIndividualFitness()
- Parameters:
-
opFitness | the operator fitness values for an operator |
liCreatedIndividualInfos | the information about individual the operator to opFitness had created, but which are not jet included in opFitness |
- Returns:
- the reevalued operator fitness
Member Data Documentation
double enviroment::cOperatorFitnessAlgorithmBasic::dFaktorAllFitnessPart |
|
protected |
double enviroment::cOperatorFitnessAlgorithmBasic::dFaktorPositivFitnessPart |
|
protected |
double enviroment::cOperatorFitnessAlgorithmBasic::dFitnessSum |
|
protected |
list< pair< const cOperation*, double > > enviroment::cOperatorFitnessAlgorithmBasic::liOperatorFitness |
|
protected |
map< string, cOperatorFitness > enviroment::cOperatorFitnessAlgorithmBasic::mapLoadedOperatorFitness |
|
protected |
map< string, cOperatorFitness > enviroment::cOperatorFitnessAlgorithmBasic::mapPastOperatorFitness |
|
protected |
string enviroment::cOperatorFitnessAlgorithmBasic::szOperationDataPath |
|
protected |
The documentation for this class was generated from the following file: