-
Notifications
You must be signed in to change notification settings - Fork 0
/
C2XDENMessage.py
216 lines (127 loc) · 5.12 KB
/
C2XDENMessage.py
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
"""
Data object for a virtual V2X DEN message, e.g. for a traffic simulation.
@since: 01.07.2010
@version: 25.10.2011
@status: ready for final review
@author: Mathias Baur
@contact: [email protected]
"""
class DENMessage(object):
FORWARDING_TYPE_BROADCAST = 0
FORWARDING_TYPE_UNICAST = 1
FORWARDING_TYPE_GEOCAST_CIRCLE = 2
FORWARDING_TYPE_GEOCAST_RECTANGLE = 3
#: constants for different communication media
MEDIUM_TYPE_PWLAN = 0
MEDIUM_TYPE_CWLAN = 1
MEDIUM_TYPE_UMTS = 2
__sourceID = 0 #: source of the message, reference to the sender
__actionID = 0 #: action ID of the message, identifies a message for a sending vehicle
__forwardingType = 0 #: forwarding via broadcast, geocast or unicast. usually, only broadcast is used. message relevance is handled by forwarding area
__forwardingArea = None #: forwarding area must be a Rectangle or a Circle type object, can be evaluated by the traces, must implement "contains"
__time = 0.0 #: sending time
__validityTime = 0 #: time in seconds until message becomes invalid
__referencePosition = None #: reference position of the causing event
__acceleration = 0.0 #: acceleration of the sender
__speed = 0.0 #: speed of the sender
__trace = None #: trace of the sender, must be a Trace type object
__causeCode = 0 #: optional code for the cause of the message
__subCause = 0 #: optional sub code for the cause of the message
__directCause = 0 #: optional cause code for the cause of the message
__cancelation = False #: Flag, indicating if message is a cancelation message
__reliability = 0 #: reliability of the message
__medium = 0 #: used medium: p-WLAN, c-WLAN, UMTS. by now, only p-WLAN can be used
__payloadData = "" #: payload content of the message
__priority = 0.0 #: priority of the message
def __init__(self):
'''
Constructor
'''
def getSourceID(self):
return self.__sourceID
def setSourceID(self, value):
self.__sourceID = value
def setActionID(self, value):
self.__actionID = value
def getActionID(self):
return self.__actionID
def getAcceleration(self):
return self.__acceleration
def setAcceleration(self, value):
self.__acceleration = value
def getSpeed(self):
return self.__speed
def setSpeed(self, value):
self.__speed = value
def getTime(self):
return self.__time
def setTime(self, value):
self.__time = value
def getTrace(self):
return self.__trace
def setTrace(self, value):
self.__trace = value
def getMedium(self):
return self.__medium
def setMedium(self, value):
self.__medium = value
def delMedium(self):
del self.__medium
def getForwardingArea(self):
return self.__forwardingArea
def getValidityTime(self):
return self.__validityTime
def getReferencePosition(self):
return self.__referencePosition
def getCauseCode(self):
return self.__causeCode
def getSubCause(self):
return self.__subCause
def getDirectCause(self):
return self.__directCause
def setForwardingArea(self, value):
self.__forwardingArea = value
def setValidityTime(self, value):
self.__validityTime = value
def setReferencePosition(self, value):
self.__referencePosition = value
def setCauseCode(self, value):
self.__causeCode = value
def setSubCause(self, value):
self.__subCause = value
def setDirectCause(self, value):
self.__directCause = value
def delForwardingArea(self):
del self.__forwardingArea
def delValidityTime(self):
del self.__validityTime
def delReferencePosition(self):
del self.__referencePosition
def delCauseCode(self):
del self.__causeCode
def delSubCause(self):
del self.__subCause
def delDirectCause(self):
del self.__directCause
def getForwardingType(self):
return self.__forwardingType
def setForwardingType(self, value):
self.__forwardingType = value
def delForwardingType(self):
del self.__forwardingType
def isCancelation(self):
return self.__cancelation
def getReliability(self):
return self.__reliability
def setCancelation(self, value):
self.__cancelation = value
def setReliability(self, value):
self.__reliability = value
def getPriority(self):
return self.__priority
def setPriority(self, value):
self.__priority = value
def getPayloadData(self):
return self.__payloadData
def setPayloadData(self, value):
self.__payloadData = value