forked from heremaps/flatdata
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraph.flatdata
More file actions
55 lines (48 loc) · 1.11 KB
/
graph.flatdata
File metadata and controls
55 lines (48 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
namespace benchmark {
// Each edge has:
// * data
// * a from node
// * a to node
struct EdgeData{
id: u64;
from: u32;
to: u32;
length: u32;
speed_pos: u8;
speed_neg: u8;
is_a: bool;
is_b: bool;
is_c: bool;
is_d: bool;
is_e_pos: bool;
is_e_neg: bool;
is_f_pos: bool;
is_f_neg: bool;
is_g_pos: bool;
is_g_neg: bool;
frc: u8: 3;
}
// Models an edge adjacent to a node
// In addition to the id of the edge it stores the direction of the edge
struct AdjacentEdge{
id: u32: 31;
dir: u8: 1;
}
// Each node has a list of (directed) edges adjacent to it
struct Node{
x: u32;
y: u32;
@range(adjacent_edges)
first_adjacent_edge: u32;
}
// Models a graph consistent of nodes and edges, as well as their connectivity
archive Graph {
@explicit_reference( Node.first_adjacent_edge, adjacent_edges )
nodes: vector<Node>;
@explicit_reference( AdjacentEdge.id, edge_data )
adjacent_edges: vector<AdjacentEdge>;
@explicit_reference( EdgeData.from, nodes )
@explicit_reference( EdgeData.to, nodes )
edge_data: vector<EdgeData>;
}
}