-
Notifications
You must be signed in to change notification settings - Fork 0
/
BubbleProtocol.h
37 lines (25 loc) · 1.17 KB
/
BubbleProtocol.h
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
//
// Created by cyx02 on 2022/6/27.
//
#ifndef BUBBLEMAC_INFOCOM_BUBBLEPROTOCOL_H
#define BUBBLEMAC_INFOCOM_BUBBLEPROTOCOL_H
#include<vector>
#include <queue>
using namespace std;
void BubbleMAC(struct Duallist *ALL_Vehicles, int slot);
void deleteOutdatedPackets(queue<struct packet*> *packets, int slot);
void UpdateOneFrameInfo(struct vehicle* aCar);
/*----------------------------*/
void bubble(struct Duallist *ALL_Vehicles, int slot);
void handle_packets(struct vehicle* aCar, int slot);
void choose_commRange(struct vehicle* aCar, int slot);
bool IsMergingCollision(struct vehicle* aCar, int slot);
bool IsValidRole(struct vehicle* aCar);
int choose_slot(struct vehicle* aCar, int role, int slot);
struct vehicle* nearestVehicle(struct vehicle* aCar, vector<struct vehicle*> vehicleList);
double safe_range(struct vehicle* aCar, struct vehicle* frontV);
//void bubble_handle_packets(struct Duallist *ALL_Vehicles, int slot);
//void bubble_protocol_commRange(struct Duallist * ALL_vehicles, int slot);
//void bubble_protocol_slot(struct Duallist *ALL_Vehicles, int slot);
//void slot_determine_for_access(struct vehicle* aCar, int role);
#endif //BUBBLEMAC_INFOCOM_BUBBLEPROTOCOL_H