1 | /************************************************************************************ |
---|
2 | * Copyright (C) 2008 by Politehnica University of Bucharest and Rutgers University |
---|
3 | * All rights reserved. |
---|
4 | * Refer to LICENSE for terms and conditions of use. |
---|
5 | ***********************************************************************************/ |
---|
6 | package vnsim.network.dsrc; |
---|
7 | |
---|
8 | import vnsim.map.object.Globals; |
---|
9 | |
---|
10 | public class DSRCStatisticComponent |
---|
11 | { |
---|
12 | private int componentId; |
---|
13 | |
---|
14 | //cummulative number of packets received from a specific transmitter |
---|
15 | private long receivedFromFV,receivedFromNFV,receivedFromLAV,receivedFromRAV; |
---|
16 | |
---|
17 | //packet average inter reception time for different transmitters |
---|
18 | private double IRTFromFV,IRTFromNFV,IRTFromLAV,IRTFromRAV; |
---|
19 | |
---|
20 | //packet success probability from a given transmitter |
---|
21 | private double PSPFromFV ,PSPFromNFV,PSPFromLAV,PSPFromRAV; |
---|
22 | |
---|
23 | public long weakPackets; |
---|
24 | public long totalPackets; |
---|
25 | public long corruptedPackets; |
---|
26 | public long collisionPackets; |
---|
27 | public long lostTxPackets; |
---|
28 | public long lostRxPackets; |
---|
29 | public long lostPerPackets; |
---|
30 | public long OkPackets; |
---|
31 | |
---|
32 | // send failure packets |
---|
33 | public long sendFailureRXPackets=0; |
---|
34 | public long sendFailureNoisePackets=0; |
---|
35 | |
---|
36 | public int numberOfCars; |
---|
37 | |
---|
38 | public long emergencyReceived=0; |
---|
39 | public long emergencySent=0; |
---|
40 | |
---|
41 | public DSRCStatisticComponent(int componentId,long weakPackets,long totalPackets,long corruptedPackets,long collisionPackets,long lostTxPackets |
---|
42 | ,long lostRxPackets,long lostPerPackets,long OkPackets,long sendFailureRXPackets,long sendFailureNoisePackets, |
---|
43 | long receivedFromFV,long receivedFromNFV,long receivedFromLAV,long receivedFromRAV,double IRTFromFV,double IRTFromNFV, |
---|
44 | double IRTFromLAV,double IRTFromRAV,double PSPFromFV,double PSPFromNFV,double PSPFromLAV,double PSPFromRAV,int numberOfCars,long emergencyReceived,long emergencySent) |
---|
45 | { |
---|
46 | this.weakPackets=weakPackets; |
---|
47 | this.totalPackets=totalPackets; |
---|
48 | this.corruptedPackets=corruptedPackets; |
---|
49 | this.collisionPackets=collisionPackets; |
---|
50 | this.lostTxPackets=lostTxPackets; |
---|
51 | this.lostRxPackets=lostRxPackets; |
---|
52 | this.lostPerPackets=lostPerPackets; |
---|
53 | this.OkPackets=OkPackets; |
---|
54 | |
---|
55 | this.sendFailureNoisePackets=sendFailureNoisePackets; |
---|
56 | this.sendFailureRXPackets=sendFailureRXPackets; |
---|
57 | |
---|
58 | this.receivedFromFV=receivedFromFV; |
---|
59 | this.receivedFromLAV=receivedFromLAV; |
---|
60 | this.receivedFromNFV=receivedFromNFV; |
---|
61 | this.receivedFromRAV=receivedFromRAV; |
---|
62 | |
---|
63 | this.IRTFromFV=((receivedFromFV!=0)?IRTFromFV/this.receivedFromFV:0)/Globals.SECOND; |
---|
64 | this.IRTFromLAV=((receivedFromLAV!=0)?IRTFromLAV/this.receivedFromLAV:0)/Globals.SECOND; |
---|
65 | this.IRTFromNFV=((receivedFromNFV!=0)?IRTFromNFV/this.receivedFromNFV:0)/Globals.SECOND; |
---|
66 | this.IRTFromRAV=((receivedFromRAV!=0)?IRTFromRAV/this.receivedFromRAV:0)/Globals.SECOND; |
---|
67 | |
---|
68 | this.PSPFromFV=PSPFromFV; |
---|
69 | this.PSPFromLAV=PSPFromLAV; |
---|
70 | this.PSPFromNFV=PSPFromNFV; |
---|
71 | this.PSPFromRAV=PSPFromRAV; |
---|
72 | |
---|
73 | this.componentId=componentId; |
---|
74 | |
---|
75 | this.numberOfCars=numberOfCars; |
---|
76 | |
---|
77 | this.emergencyReceived=emergencyReceived; |
---|
78 | this.emergencySent=emergencySent; |
---|
79 | |
---|
80 | } |
---|
81 | |
---|
82 | public long getTotalPackets() |
---|
83 | { |
---|
84 | return this.totalPackets; |
---|
85 | } |
---|
86 | |
---|
87 | public long getCorruptedPackets() |
---|
88 | { |
---|
89 | return this.corruptedPackets; |
---|
90 | } |
---|
91 | |
---|
92 | public long getCollisionPackets() |
---|
93 | { |
---|
94 | return this.collisionPackets; |
---|
95 | } |
---|
96 | |
---|
97 | public long getLostTxPackets() |
---|
98 | { |
---|
99 | return this.lostTxPackets; |
---|
100 | } |
---|
101 | |
---|
102 | public long getLostRxPackets() |
---|
103 | { |
---|
104 | return this.lostRxPackets; |
---|
105 | } |
---|
106 | |
---|
107 | public long getLostPerPackets() |
---|
108 | { |
---|
109 | return this.lostPerPackets; |
---|
110 | } |
---|
111 | |
---|
112 | public long getOkPackets() |
---|
113 | { |
---|
114 | return this.OkPackets; |
---|
115 | } |
---|
116 | |
---|
117 | public long getSendFailureRXPackets() |
---|
118 | { |
---|
119 | return this.sendFailureRXPackets; |
---|
120 | } |
---|
121 | |
---|
122 | public long getSendFailureNoisePackets() |
---|
123 | { |
---|
124 | return this.sendFailureNoisePackets; |
---|
125 | } |
---|
126 | |
---|
127 | public long getReceivedFromFV() |
---|
128 | { |
---|
129 | return this.receivedFromFV; |
---|
130 | } |
---|
131 | |
---|
132 | public long getReceivedFromNFV() |
---|
133 | { |
---|
134 | return this.receivedFromNFV; |
---|
135 | } |
---|
136 | |
---|
137 | public long getReceivedFromLAV() |
---|
138 | { |
---|
139 | return this.receivedFromLAV; |
---|
140 | } |
---|
141 | |
---|
142 | public long getReceivedFromRAV() |
---|
143 | { |
---|
144 | return this.receivedFromRAV; |
---|
145 | } |
---|
146 | |
---|
147 | public double getIRTFromFV() |
---|
148 | { |
---|
149 | return this.IRTFromFV; |
---|
150 | } |
---|
151 | |
---|
152 | public double getIRTFromNFV() |
---|
153 | { |
---|
154 | return this.IRTFromNFV; |
---|
155 | } |
---|
156 | |
---|
157 | public double getIRTFromLAV() |
---|
158 | { |
---|
159 | return this.IRTFromLAV; |
---|
160 | } |
---|
161 | |
---|
162 | public double getIRTFromRAV() |
---|
163 | { |
---|
164 | return this.IRTFromRAV; |
---|
165 | } |
---|
166 | |
---|
167 | public double getPSPFromFV() |
---|
168 | { |
---|
169 | return this.PSPFromFV; |
---|
170 | } |
---|
171 | |
---|
172 | public double getPSPFromNFV() |
---|
173 | { |
---|
174 | return this.PSPFromNFV; |
---|
175 | } |
---|
176 | |
---|
177 | public double getPSPFromLAV() |
---|
178 | { |
---|
179 | return this.PSPFromLAV; |
---|
180 | } |
---|
181 | |
---|
182 | public double getPSPFromRAV() |
---|
183 | { |
---|
184 | return this.PSPFromRAV; |
---|
185 | } |
---|
186 | |
---|
187 | public int getComponentId() |
---|
188 | { |
---|
189 | return this.componentId; |
---|
190 | } |
---|
191 | |
---|
192 | public int getNumberOfCars() |
---|
193 | { |
---|
194 | return this.numberOfCars; |
---|
195 | } |
---|
196 | |
---|
197 | public long getEmergencyReceived() |
---|
198 | { |
---|
199 | return this.emergencyReceived; |
---|
200 | } |
---|
201 | |
---|
202 | public long getEmergencySent() |
---|
203 | { |
---|
204 | return this.emergencySent; |
---|
205 | } |
---|
206 | |
---|
207 | public long getWeakPackets() |
---|
208 | { |
---|
209 | return this.weakPackets; |
---|
210 | } |
---|
211 | } |
---|