00001 #include "ECF_base.h"
00002 #include "FitnessMax.h"
00003 #include<sstream>
00004
00005
00006 bool FitnessMax::isBetterThan(FitnessP other)
00007 {
00008 return value_ > other->getValue();
00009 }
00010
00011
00012 FitnessMax* FitnessMax::copy()
00013 {
00014 FitnessMax *newObject = new FitnessMax(*this);
00015 return newObject;
00016 }
00017
00018
00019 void FitnessMax::write(XMLNode &xFitness)
00020 {
00021 xFitness = XMLNode::createXMLTopNode("FitnessMax");
00022 std::stringstream sValue;
00023 sValue << value_;
00024 xFitness.addAttribute("value", sValue.str().c_str());
00025 }