RM: added into dispatcher strucure
This commit is contained in:
@ -9,10 +9,11 @@
|
||||
//sets relations of speed for the different layers
|
||||
map<int,float> DestructionPower_Properties::SpeedTable =
|
||||
{
|
||||
{0,0.99}
|
||||
{0,0.99},
|
||||
{1,0.7},
|
||||
{2,0.7}
|
||||
};
|
||||
|
||||
|
||||
bool DestructionPower::PreProcessing(coor mySize,const vector<Part*>* partArray)
|
||||
{
|
||||
cout << "DestructionPower Preprocessing... ";
|
||||
@ -55,7 +56,7 @@ void DestructionPower::DestructionOfSurrounding(const coor constraintCoordinate)
|
||||
m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].DestructionArray[i] /=divisor;
|
||||
else
|
||||
//create default destructionPower //TODO find some better solution for default
|
||||
m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].DestructionArray[i] =1-m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].SpeedTable[i];
|
||||
m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].DestructionArray[i] = m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].SpeedTable[i];
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,6 +103,6 @@ DestructionPower_Properties::DestructionPower_Properties() {
|
||||
|
||||
{
|
||||
DestructionArray.emplace_back((DestructionPower_Properties::SpeedTable[i]*DESTRUCTION_INIT));
|
||||
DestructionArray.back()<0.99 ? DestructionArray.back()*=aging:DestructionArray.back();
|
||||
DestructionArray.back()<0.8 ? DestructionArray.back()=aging*DestructionArray.back()+(float)0.01:DestructionArray.back();
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,8 @@
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#define DESTRUCTION_COUNT 1
|
||||
//TODO!! increase Destructioncount
|
||||
#define DESTRUCTION_COUNT 2
|
||||
|
||||
#include "DestructionPower_Properties.h"
|
||||
#include "../AbstraktionLayer_Base.h"
|
||||
|
@ -71,7 +71,7 @@ HistogramComparer localImage;
|
||||
calcHist(&hsv_img1, 1, channels, Mat(), hist_img1, 2, histSize, ranges, true, false);
|
||||
// normalize(hist_img1, hist_img1, 0, 1, NORM_MINMAX, -1, Mat());
|
||||
|
||||
ref_partArray[iterator]->m_aHistogram.image=hsv_img1;
|
||||
ref_partArray[iterator]->m_Histogram.image=hsv_img1;
|
||||
iterator++;
|
||||
|
||||
}
|
||||
@ -89,7 +89,7 @@ bool AbstractionLayer_Histogram::EvaluateQuality (const coor constraintCoordinat
|
||||
//evaluateQuality = evaluateProbabilaty
|
||||
for(int i = 0;i < qVector.size();i++)
|
||||
{
|
||||
if(PlaceOfPartGood(constraintCoordinate, qVector[i].second->m_aHistogram.image))
|
||||
if(PlaceOfPartGood(constraintCoordinate, qVector[i].second->m_Histogram.image))
|
||||
{
|
||||
qVector[i].first=1;
|
||||
|
||||
@ -147,7 +147,7 @@ bool HistogramComparer::CompareHistogram(Mat hist_img1,Mat hist_img2)
|
||||
|
||||
bool AbstractionLayer_Histogram::SetConstraintOnPosition(const coor constraintCoordinate, const AbstractionLayer_Histogram_Properties constraint)
|
||||
{
|
||||
m_constraintMatrix[constraintCoordinate.col+1][constraintCoordinate.row+1].image=constraint.image;
|
||||
m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].image=constraint.image;
|
||||
//m_constraintMatrix[constraintCoordinate.col+1][constraintCoordinate.row+1].m_connections=constraint.m_connections;
|
||||
}
|
||||
|
||||
@ -156,5 +156,5 @@ bool AbstractionLayer_Histogram::SetConstraintOnPosition(const coor constraintCo
|
||||
bool AbstractionLayer_Histogram::RemoveConstraintOnPosition(const coor constraintCoordinate)
|
||||
{
|
||||
Mat dummy(1,1,0);
|
||||
m_constraintMatrix[constraintCoordinate.col+1][constraintCoordinate.row+1].image = dummy;
|
||||
m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].image = dummy;
|
||||
}
|
||||
|
Reference in New Issue
Block a user