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();
187 bool selectAgent(
int agentId );
199 void enableAgent(
int agentId );
211 void disableAgent(
int agentId );
220 bool agentEnabled(
int agentId );
225 Evonet* getNeuralNetwork(
int agentId=0 );
227 void setNetParameters(
int *genes);
229 virtual void initGeneration(
int generation);
231 virtual void initIndividual(
int individual);
234 virtual void initTrial(
int trial);
236 virtual void initStep(
int step );
285 void endIndividualLife();
290 virtual void afterSensorsUpdate();
294 virtual void beforeMotorsUpdate();
298 virtual void beforeWorldAdvance();
300 virtual void endStep(
int step ) = 0;
304 virtual void endTrial(
int trial);
307 virtual void endIndividual(
int individual);
309 virtual void endGeneration(
int generation);
311 void doAllTrialsForIndividual(
int individual);
314 int getGenomeLength();
321 Sensor* getSensor( QString sensorName,
int agentId=0 );
328 Motor* getMotor( QString motorName,
int agentId=0 );
336 virtual void setTestingAgentAndSeed(
int idindividual,
int nreplica );
386 static void describe( QString type );
392 virtual void postConfigureInitialization();
399 int getNTrials()
const
409 ntrials = new_ntrials;
417 int getNSteps()
const
435 int getCurStep()
const
445 int getCurTrial()
const
455 void setStepDelay(
int delay );
461 float getWorldTimeStep()
const;
477 void recreateWorld();
491 bool recreateRobot(
int agentId = 0 );
498 void recreateAllRobots();
504 void recreateArena();
516 void recreateNeuralNetwork(
int agentId = 0 );
523 void recreateAllNeuralNetworks();
533 const QString* savedPrefix;
542 void setWorldTimestep(
float timestep );
545 class EmbodiedAgent {
554 void recreateRobot();
556 void recreateNeuralNetwork();
572 QString resourcePrefix;
580 QVector<Sensor*> sensors;
582 QVector<Motor*> motors;
584 QMap<QString, Sensor*> sensorsMap;
586 QMap<QString, Motor*> motorsMap;
598 QList<EmbodiedAgent*> eagents;
604 bool stopCurrentTrial;
606 bool skipCurrentTrial;
608 bool restartCurrentTrial;
610 bool endCurrentIndividualLife;