edited destructionLayer, changed includes

This commit is contained in:
Raphael Maenle 2017-12-20 23:01:04 +01:00
parent e641199ce4
commit 37eed7ef88
7 changed files with 27 additions and 25 deletions

View File

@ -10,6 +10,7 @@ set(SOURCE_FILES
functions/solve/classExtension.cpp functions/solve/classExtension.cpp
functions/solve/structure.cpp functions/solve/structure.cpp
functions/AbstractionLayers/AbstraktionLayer_Base.h functions/AbstractionLayers/AbstraktionLayer_Base.h
functions/AbstractionLayers/DestructionPower/DestructionPower.cpp
) )
add_executable(PuzzleSolver ${SOURCE_FILES}) add_executable(PuzzleSolver ${SOURCE_FILES})
include_directories(${OpenCV_INCLUDE_DIRS}) include_directories(${OpenCV_INCLUDE_DIRS})

View File

@ -9,7 +9,6 @@
#define DESTRUCTION_COUNT 1 #define DESTRUCTION_COUNT 1
#include "../AbstraktionLayer_Base.h" #include "../AbstraktionLayer_Base.h"
#include "DestructionPower_Properties.h"
#include <vector> #include <vector>
#include <iostream> #include <iostream>
#include <bitset> #include <bitset>

View File

@ -5,8 +5,6 @@
#ifndef SOURCE_DESTRUCTIONPOWER_PROPERTIES_H #ifndef SOURCE_DESTRUCTIONPOWER_PROPERTIES_H
#define SOURCE_DESTRUCTIONPOWER_PROPERTIES_H #define SOURCE_DESTRUCTIONPOWER_PROPERTIES_H
#include <stdint.h> #include <stdint.h>
#include "DestructionPower.h" #include "DestructionPower.h"
@ -15,21 +13,35 @@ class DestructionPower_Properties
public: public:
DestructionPower_Properties() DestructionPower_Properties()
{ {
for(int i=0;i<DestructionArray.size();i++) for(int i=0;i<sizeof(DestructionArray);i++)
DestructionArray[i]=(map[i]*DESTRUCTION_INIT); DestructionArray[i]=(SpeedTable[i]*DESTRUCTION_INIT);
setSpeedTable();
} }
map<int,float> getSpeedTable()
{
return SpeedTable;
}
void setSpeedTable()
{ SpeedTable=create_SpeedTable();}
private: private:
static map<int,float> create_SpeedTable();
static map<int,float> SpeedTable;
float DestructionArray[DESTRUCTION_COUNT]; float DestructionArray[DESTRUCTION_COUNT];
static map<int,float> SpeedTable = create_SpeedTable;
friend class DestructionPower; friend class DestructionPower;
static map<int,float> create_SpeedTable(){
map<int, float> m;
m[1] = 0.001;
return m;
}
}; };
map<int,float> DestructionPower_Properties::create_SpeedTable()
{
map<int, float> m;
m[1] = 0.001;
return m;
}
#endif //SOURCE_ABSTRACTIONLAYER_1_PROPERTIES_H #endif //SOURCE_ABSTRACTIONLAYER_1_PROPERTIES_H

View File

@ -6,7 +6,6 @@
#define SOURCE_ABSTRACTIONLAYER_1_H #define SOURCE_ABSTRACTIONLAYER_1_H
#include "../AbstraktionLayer_Base.h" #include "../AbstraktionLayer_Base.h"
#include "AbstractionLayer_1_Properties.h"
#include <vector> #include <vector>
#include <iostream> #include <iostream>
#include <bitset> #include <bitset>

View File

@ -11,9 +11,5 @@
using namespace std; using namespace std;
/** #include "header/input.h"
* IMPORTANT: Each new layer must be included there, to avoid compile errors
*/
#include "functions/AbstractionLayers/Layer1/AbstractionLayer_1.cpp"
#include "header/solve.h" #include "header/solve.h"

View File

@ -1,9 +1,7 @@
#ifndef SOURCE_PART_H
#define SOURCE_PART_H
#include <stdint.h> #include <stdint.h>
#include "../functions/AbstractionLayers/Layer1/AbstractionLayer_1_Properties.h"
#include "../functions/AbstractionLayers/DestructionPower/DestructionPower_Properties.h" class AbstractionLayer_1_Properties;
class DestructionPower_Properties;
class Part class Part
{ {
public: public:
@ -37,5 +35,3 @@ private:
int32_t m_partID; int32_t m_partID;
uint8_t m_numOfRotations; uint8_t m_numOfRotations;
}; };
#endif //SOURCE_PART_H

View File

@ -3,7 +3,6 @@
#include <vector> #include <vector>
#include <iostream> #include <iostream>
#include "input.h"
#include <opencv2/highgui/highgui.hpp> #include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp> #include <opencv2/imgproc/imgproc.hpp>