00001 #include "GLBaseMutator.h"
00002 #include "GLLogicError.h"
00003
00004
00009 GLBaseMutator::GLBaseMutator(const GLBaseMutator& mutator)
00010 {
00011 m_mutation_rate = mutator.m_mutation_rate;
00012 }
00013
00014
00018 void GLBaseMutator::reset()
00019 {
00020
00021 }
00022
00031 void GLBaseMutator::setMutationRate(double mutation_rate,
00032 bool check_range)
00033 {
00034 if (check_range && ((mutation_rate <= 0) || (mutation_rate > 1)))
00035 {
00036 char errormsg[1000];
00037 sprintf(errormsg, "\nGLBaseMutator::setMutationRate\n"
00038 "Range check is on and mutationRate (= %e)"
00039 "is outside the (0; 1) interval\n",
00040 mutation_rate);
00041 throw GLLogicError(errormsg);
00042 }
00043 m_mutation_rate = mutation_rate;
00044 }