39 iNode = state_->getRandomizer()->getRandomInteger((
int) tree->size());
41 }
while((name = tree->at(iNode)->primitive_->getName()).substr(0, 2) != DBL_PREFIX && tries < 4);
43 if(name.substr(0, 2) != DBL_PREFIX) {
44 ECF_LOG(state_, 5,
"TreeMutGauss not successful.");
49 PrimitiveP oldPrim = tree->at(iNode)->primitive_;
50 tree->at(iNode)->primitive_->getValue(&oldValue);
51 std::string oldName = tree->at(iNode)->primitive_->getName();
55 std::normal_distribution<double> N(0, 1);
62 double offset = N(engine_);
63 double newValue = oldValue + offset;
70 newName = DBL_PREFIX + newName;
72 oldPrim->setName(newName);
73 oldPrim->setValue(&newValue);
77 std::stringstream log;
78 log <<
"TreeMutGauss successful (oldNode = " << oldName <<
", newNode = " << newName <<
")";
79 ECF_LOG(state_, 5, log.str());