evorobotcomponent.h
1 /********************************************************************************
2  * FARSA Experiments Library *
3  * Copyright (C) 2007-2012 *
4  * Gianluca Massera <emmegian@yahoo.it> *
5  * Stefano Nolfi <stefano.nolfi@istc.cnr.it> *
6  * Tomassino Ferrauto <tomassino.ferrauto@istc.cnr.it> *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the Free Software *
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
21  ********************************************************************************/
22 
23 #ifndef EVOROBOTCOMPONENT_H
24 #define EVOROBOTCOMPONENT_H
25 
26 #include "component.h"
27 #include "evoga.h"
28 #include "workerthread.h"
29 #include "baseexception.h"
30 #include <QMutex>
31 
32 namespace farsa {
33 
39 class FARSA_EXPERIMENTS_API EvoRobotComponent : public Component {
40  Q_OBJECT
41 public:
47  ParameterSettableUI* getUIManager();
49  virtual void configure(farsa::ConfigurationParameters& params, QString prefix);
51  virtual void save(farsa::ConfigurationParameters& params, QString prefix);
53  virtual void postConfigureInitialization();
57  virtual void stopCurrentOperation();
59  static void describe( QString type );
61  Evoga* getGA();
62 public slots:
64  void stop();
66  void evolve();
68  void runTest();
70  void runTestFromQAction();
73  void exceptionDuringOperation(farsa::BaseException *e);
77  void onThreadOperationDone( QString message );
78 signals:
80  void actionFinished();
81 private:
83  Evoga* ga;
85  WorkerThread* gaThread;
87  bool batchRunning;
89  bool runningOperation;
91  QMutex mutex;
93  QString currentTestName;
94 };
95 
96 } // end namespace farsa
97 
98 #endif
Genetic algorithm from evorobot more or less (spare parts)
Definition: evoga.h:50
This class setup an evolutionary experiment.
The Component is the base (abstract) class for any specific project implementation.
Definition: component.h:45