27 #include "evorobotcomponent.h"
28 #include "evorobotexperiment.h"
30 #include "configurationhelper.h"
40 m_tooltip =
"Create a random genotype and it will run a test on it";
53 int* randomDna =
new int[length];
59 for(
int i=0; i<length; i++)
61 randomDna[i] = rand()%256;
81 Logger::info(
"Test Random Individual - Starting the test of an agent with a random DNA" );
101 populationLoaded(true)
104 m_tooltip =
"Run a test on the individual selected with \"Individual to Test\" view";
115 if ( !filename.isEmpty() ) {
124 if ( !populationFile.isEmpty() ) {
127 params.
createParameter( prefix,
"idIndividual", QString::number(idIndividual) );
132 d.
describeString(
"populationFile" ).
help(
"The name of the file from wich to load the genotypes to test" );
138 if ( !populationLoaded ) {
141 QRegExp reg(
"[BG][0-9]+S([0-9]+).gen");
142 reg.indexIn( populationFile );
144 Logger::info( QString(
"TestIndividual - Loaded Genome from %1").arg(populationFile) );
145 populationLoaded =
true;
147 if (idIndividual >=
int(
component()->getGA()->numLoadedGenotypes())) {
148 Logger::error( QString(
"TestIndividual - Individual %1 doesn't exists (%2 individual have been loaded)").arg(idIndividual).arg(
component()->getGA()->numLoadedGenotypes()) );
151 Logger::info( QString(
"TestIndividual - Start of the Test of Individual %1").arg(idIndividual) );
158 Logger::info( QString(
"TestIndividual - End of the Test of Individual %1").arg(idIndividual) );
162 this->idIndividual = idIndividual;
166 if ( populationFile != filename ) {
167 populationFile = filename;
168 populationLoaded =
false;
170 if ( !deferLoading ) {
173 QRegExp reg(
"[BG][0-9]+S([0-9]+).gen");
174 reg.indexIn( populationFile );
176 Logger::info( QString(
"TestIndividual - Loaded Genome from %1").arg(populationFile) );
177 populationLoaded =
true;
185 m_tooltip =
"Run a test on the current individual";
208 Logger::info( QString(
"TestCurrent - Start of the Test of Current Individual") );
214 Logger::info( QString(
"TestCurrent - End of the Test of Current Individual") );