Aquila  2.0 prealpha
Cognitive Robotics Architecture
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
som.h
Go to the documentation of this file.
1 //##############################################################################################################################################################################################################//
2 //Aquila - An Open-Source GPU-Accelerated Toolkit for Cognitive and Neuro-Robotics Research //
3 // //
4 //Copyright (c) <2012>, <Martin Peniak - www.martinpeniak.com> //
5 //All rights reserved. //
6 // //
7 //Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: //
8 // //
9 // - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. //
10 // - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. //
11 // //
12 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR //
13 //A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT //
14 //LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR //
15 //TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. //
16 // //
17 //The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted //
18 //as representing official policies,either expressed or implied, of the FreeBSD Project. //
19 //##############################################################################################################################################################################################################//
20 
21 #ifndef SOM_MAP_H
22 #define SOM_MAP_H
23 
24 #include "plot3d.h"
25 #include "mainWindow.h"
26 #include "ui_mainWindow.h"
27 #include "ui_som.h"
28 #include "somSettings.h"
29 #include "somInterface.h"
30 
31 namespace Ui
32 {
33  class SOM;
34 }
35 
37 class SOM : public GUI
38 {
39  Q_OBJECT
40 
41 public:
42  SOM(MainWindow *pMainWindow, QString binaryName, QString moduleTitle, QString serverName, int instanceID, int tabID=-1);
43  ~SOM();
44 
45 protected:
46  void createFileMenu();
47  void createSaveSubmenu();
48 
49 protected slots:
50  void about();
51  void updateGUI();
52 
53 private:
54  Ui::SOM *ui;
55  SOMInterface *intrfc;
56  SOMSettings *settings;
57 
58  QSignalMapper *saveSignalMapper;
59  QMenu *saveSubMenu;
60  QAction *saveAct[2];
61  QAction *trainAct;
62  QAction *viewAct;
63 
64  float learningRate;
65  float trainingTime;
66  float highestDataPoint;
67  float lowestDataPoint;
68  bool viewingMode;
69  bool mapLoaded;
70 
71  void setupGUI();
72  void showMapProperties(int numOutputs, int vectorDimensions, int subIterationsUsed, double learningRateUsed);
73 
74 private slots:
75  void initRenderModeComboBox();
76  void inputMappingChanged();
77  void startTraining();
78  void viewMap();
79  void save(int targetID);
80  void saveTrainingTime(float time);
81  void saveDataPoints(float low, float hi);
82  void initInputMappingComboBoxes(int numInputs);
83  void setPlotInputs(QVector<float> map);
84 };
85 
86 #endif//SOM_MAP_H