- Navigate to src/ folder by
cd src
- Delete class files using
rm *.class
- Compile by
javac Simulation.java
- Regular run using
java Simulation
- Run with assertions using
java -ea Simulation
- Run with async-profiler using
java -agentpath:/home/nitin/async-profiler-1.7-linux-x64/build/libasyncProfiler.so=start,file=profile.svg Simulator
- All logs are stored at
logs/
which is in the same level assrc/
- Each run will generate a unique folder using System.currentTimeMillis() eg.
1588266314130/
- Each invocation of run() of Simulation class will have a log file eg.
24_60/
- A csv file (to generate plots) will be generated having results from all the Simulation.run() invocations.
Definitions of plotted metrics:
- Clustering overhead vs Vehicle density
Defined as the ratio of total cloud formation packets transmitted vs total packets transmitted - Cloud formation time vs Vehicle density Formation time for a (fresh) cloud is the difference between leader recognising itself as leader and the request generation time
- Leader changes vs Vehicle Speed
- Requests Generated/Serviced/Queued vs Vehicle density Use a stacked column graph to verify thar requests are being full-filled by the leader.
Graphs are available at this Google Sheets link.
Following results were obtained using time java Simulator
Vehicle density | real | user | sys | Remarks | commit |
---|---|---|---|---|---|
(8,36,4) | 36m7.589s | 100m27.850s | 29m24.983s | Full simulation first half | dfc6715 |
24 | 32m9.841s | 82m49.220s | 25m19.116s | Full simulation second half | dfc6715 |
24 | 5m15.805s | 13m58.626s | 4m5.868s | Single run | dfc6715 |
24 | 2m44.564s | 7m15.348s | 1m59.026s | Single run | perf-optimisation |
- CSMA pseudocode:
if (backoff == 0) {
if channel is free {
transmit
backoff = 0
cw = cw_base
}
else {
cw *= 2
if (cw < cw_max) {
backoff = rand(cw) + 1
}
else {
// could not transfer start all over again
}
}
}
else {
if channel is free {
decrement backoff
}
}