24 #ifndef EVOROBOTEXPERIMENT_H
25 #define EVOROBOTEXPERIMENT_H
27 #include "resourcesuser.h"
29 #include "neuroninterfaces.h"
32 #include "physphere.h"
34 #include "phycylinder.h"
35 #include "configurationparameters.h"
36 #include "parametersettable.h"
39 #include "simpletimer.h"
41 #include <QCoreApplication>
165 void setEvoga(
Evoga* ga );
169 bool inBatchRunning();
185 void selectAgent(
int agentId );
189 Evonet* getNeuralNetwork(
int agentId=0 );
191 void setNetParameters(
int *genes);
193 virtual void initGeneration(
int generation);
195 virtual void initIndividual(
int individual);
197 virtual void initTrial(
int trial);
199 virtual void initStep(
int step );
248 void endIndividualLife();
253 virtual void afterSensorsUpdate();
257 virtual void beforeMotorsUpdate();
261 virtual void beforeWorldAdvance();
263 virtual void endStep(
int step ) = 0;
267 virtual void endTrial(
int trial);
270 virtual void endIndividual(
int individual);
272 virtual void endGeneration(
int generation);
274 void doAllTrialsForIndividual(
int individual);
277 int getGenomeLength();
282 Sensor* getSensor( QString sensorName,
int agentId=0 );
287 Motor* getMotor( QString motorName,
int agentId=0 );
295 virtual void setTestingAgentAndSeed(
int idindividual,
int nreplica );
345 static void describe( QString type );
351 virtual void postConfigureInitialization();
358 int getNTrials()
const
368 ntrials = new_ntrials;
376 int getNSteps()
const
394 int getCurStep()
const
404 int getCurTrial()
const
414 void setStepDelay(
int delay );
420 float getWorldTimeStep()
const;
436 void recreateWorld();
448 void recreateRobot(
int agentId = 0 );
455 void recreateAllRobots();
461 void recreateArena();
472 void recreateNeuralNetwork(
int agentId = 0 );
479 void recreateAllNeuralNetworks();
489 const QString* savedPrefix;
498 void setWorldTimestep(
float timestep );
501 class EmbodiedAgent {
510 void recreateRobot();
512 void recreateNeuralNetwork();
518 QString resourcePrefix;
526 QVector<Sensor*> sensors;
528 QVector<Motor*> motors;
530 QMap<QString, Sensor*> sensorsMap;
532 QMap<QString, Motor*> motorsMap;
544 QList<EmbodiedAgent*> eagents;
550 bool stopCurrentTrial;
552 bool skipCurrentTrial;
554 bool restartCurrentTrial;
556 bool endCurrentIndividualLife;