## root / trunk / code / projects / traffic_navigation / mapping.hold @ 1979

History | View | Annotate | Download (1012 Bytes)

1 |
#include "intersectData.h" |
---|---|

2 | |

3 |
/* Data is sent in the following order |

4 |
* INT0_NUM OUTEDGE_0 OUTEDGE_1 ... \n |

5 |
* INT1_NUM OUTEDGE_0 ... \n |

6 |
* ... |

7 |
* ... |

8 |
*/ |

9 | |

10 |
/* Representation of an edge (road) */ |

11 |
typedef struct { |

12 |
char to; /* Where does this edge lead to? */ |

13 |
char dist; /* Where does it come from? */ |

14 |
}edge |

15 | |

16 |
/* Representation of an intersection on the graph */ |

17 |
typedef struct { |

18 |
char type; /* Note that there are at most 5 intersection types */ |

19 |
char intNum; /* What is the intersection number */ |

20 |
char numOut; /* Note that we can have no more than 4 outgoing edges */ |

21 |
char outSeen; /* The number of the outgoing edges that we have seen for this intersection */ |

22 |
edge[4] outgoingEdges; |

23 |
}node |

24 | |

25 |
/* A union that is used in wireless transmissions */ |

26 |
typedef union { |

27 |
node n; |

28 |
char array[12]; |

29 |
}node_union |

30 | |

31 |
/* This array holds all of the intersections that are represented in the graph |

32 |
* after its creation, the graph is transmitted wirelessly */ |

33 |
node[NUM_FEATURES] intersections; |

34 | |

35 |
int createEdge(edge* newEdge); |