routing4SITA/src/routing4SITA.h

38 lines
930 B
C
Raw Normal View History

2019-05-07 21:39:02 +02:00
#ifndef ROUTING4SITA_H
2019-05-07 23:04:36 +02:00
#define ROUTING4SITA_H
2019-05-07 21:39:02 +02:00
#define MAX_CHILDREN 3
2019-05-08 00:18:30 +02:00
#define MAX_DEPTH 4
2019-05-07 21:39:02 +02:00
typedef struct node NODE_t;
2019-05-07 22:35:58 +02:00
typedef struct threadData THREAD_DATA_t;
2019-05-08 00:18:30 +02:00
typedef struct bestPath BESTPATH_t;
2019-05-07 21:39:02 +02:00
2019-05-07 23:04:36 +02:00
extern NODE_t* getStartNode();
2019-05-07 21:39:02 +02:00
struct node {
2019-05-08 00:18:30 +02:00
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
2019-05-07 21:39:02 +02:00
};
2019-05-07 22:35:58 +02:00
struct threadData {
2019-05-08 00:18:30 +02:00
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 {
2019-05-08 00:52:12 +02:00
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
2019-05-07 22:35:58 +02:00
};
2019-05-07 21:39:02 +02:00
#endif /* ROUTING4SITA_H */