get best path

This commit is contained in:
2019-05-08 00:18:30 +02:00
parent e836dfc4e2
commit 133c386a5d
4 changed files with 189 additions and 7 deletions

View File

@ -2,23 +2,36 @@
#define ROUTING4SITA_H
#define MAX_CHILDREN 3
#define MAX_DEPTH 4
typedef struct node NODE_t;
typedef struct threadData THREAD_DATA_t;
typedef struct bestPath BESTPATH_t;
extern NODE_t* getStartNode();
struct node {
int id;
int nodescount;
NODE_t* nodesnext[MAX_CHILDREN];
int nodescost[MAX_CHILDREN];
int id; //identifier for this node
int nodescount; //how many children nodes
NODE_t* nodesnext[MAX_CHILDREN]; //array of children nodes
int nodescost[MAX_CHILDREN]; //array of cost per children node
};
struct threadData {
NODE_t* node;
int cost;
int depth; //depth of the next node, e.g. start --> 0
NODE_t* node; //next node to go
int cost; //cost for the next node
int predecessors[MAX_DEPTH]; // array with all predecessor
BESTPATH_t* bestpath;
};
struct bestPath {
int lowestCost;
int predecessorsBestPath[MAX_DEPTH]; // array with all predecessor of the best path
int depth; //depth of the best path, aka. how many nodes
};
#endif /* ROUTING4SITA_H */