Commit 41514689 authored by Arne Graf's avatar Arne Graf

full usage of trialfield, minor cleanup, rdy for costarrays

parent 4edf34f0
This diff is collapsed.
......@@ -62,12 +62,13 @@ class FloorfieldViaFM
double getDistance2WallAt(const Point& position);
void parseBuilding(const Building* const buildingArg, const double stepSizeX, const double stepSizeY);
void resetGoalAndCosts(const Goal* const goalArg);
void resetGoalAndCosts(std::vector<Wall>& wallArg, int numOfExits);
//void resetGoalAndCosts(const Goal* const goalArg);
void prepareForDistanceFieldCalculation(std::vector<Wall>& wallArg, int numOfExits);
void lineScan(std::vector<Wall>& wallArg, double* const target, const double outside, const double inside);
void drawLinesOnGrid(std::vector<Wall>& wallArg, double* const target, const double outside);
void calculateFloorfield(bool useDistance2Wall); //make private
void calculateDistanceField(const double thresholdArg); //make private
void setSpeed(bool useDistance2Wall);
void calculateFloorfield(double* costarray, Point* neggradarray); //make private
void calculateDistanceField(const double thresholdArg); //make private
void checkNeighborsAndAddToNarrowband(Trial* &smallest, Trial* &biggest, const long int key, std::function<void (const long int)> checkNeighborsAndCalc);
......@@ -101,6 +102,7 @@ class FloorfieldViaFM
int* flag; //flag:( 0 = unknown, 1 = singel, 2 = double, 3 = final, 4 = added to trial but not calculated, -7 = outside)
double* dist2Wall;
double* speedInitial;
double* modifiedspeed;
double* cost;
long int* secKey; //secondary key to address ... not used yet
Point* neggrad; //gradients
......
......@@ -33,6 +33,7 @@
#ifndef TRIAL_H
#define TRIAL_H
#include "../../geometry/Point.h"
class Trial // father := smaller; child := bigger (in terms of cost); cost/speed := ptr to its cost/speed
{
......@@ -43,6 +44,7 @@ class Trial // father := smaller; child := bigger (in terms of cost); cost/speed
Trial* father;
double* cost; //pointer to its cost (cost = &costarray[key])
double* speed;//pointer to its speed (speed = &speedarray[key])
Point* neggrad;
Trial() {
key = 0;
......@@ -51,15 +53,17 @@ class Trial // father := smaller; child := bigger (in terms of cost); cost/speed
father = nullptr;
cost = nullptr;
speed = nullptr;
neggrad = nullptr;
}
Trial(long int keyArg, Trial* fatherArg, Trial* childArg, double* t, double* f, int* flagArg) {
Trial(long int keyArg, Trial* fatherArg, Trial* childArg, double* t, double* f, int* flagArg, Point* neggradArg) {
key = keyArg;
father = fatherArg;
child = childArg;
cost = t;
speed = f;
flag = flagArg;
neggrad = neggradArg;
}
virtual ~Trial() {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment