Move nodes on maps
There are several possibilities to move nodes in gep-spatial environment.
This is of course the easiest way:
all data about the map is ignored.
This strategy makes sense if you need a geo-spatial coordinate system,
but you are simulating objects that are mostly or entirely unaffected by the street-level structure
(buildings, roads, etc.);
for instance, if the simulation involves unmanned aerial vehicles.
There is no need of importing actual map data when navigating this way.
This kind of navigation can be realized using
MoveToTarget
.
Examples
Click to show / hide code
incarnation: protelis
variables:
seed: &seed # You can give the anchor any name, assigning the name of the variable is convenient, though
{min: 0, max: 1, step: 1, default: 0} # This variable ranges in [0, 9], steps of 1, defaulting to 0
network-model: { type: ConnectWithinDistance, parameters: [10] }
_program-pools:
compute-gradient: &gradient
- { time-distribution: 1, program: "advanced:converge" }
- program: send
move: &move
- time-distribution: { type: ExponentialTime, parameters: [1] }
type: Event
actions: { type: MoveToTarget, parameters: [destination, 1] }
deployments: { type: Circle, parameters: [50, 0, 0, 5], programs: [*gradient, *move] }
terminate: { type: AfterTime, parameters: [20] }
Click to show / hide code
incarnation: protelis
variables:
time: &time
type: Flag
parameters: [false]
small: &small
type: Flag
parameters: [false]
n: &n
formula: 100
range: &range
formula: 30
width: &w
formula: 200
height: &h
formula: 20
freq: &freq
formula: 1
sp:
formula: 0.1
bp:
formula: 0.5
retain: &retain
formula: 1 / minfreq
fc:
formula: "time ? (small ? sp : bp) : 0"
minfreq: &minfreq
formula: "freq * (1 - fc)"
maxfreq: &maxfreq
formula: "freq * (1 + fc)"
speed: &speed
language: kotlin
formula: "if (time as Boolean) 0 else 1"
seed: &seed
min: 0
max: 199
step: 1
default: 0
seeds:
scenario: *seed
simulation: *seed
network-model:
type: ConnectWithinDistance
parameters: [*range]
_pools:
- pool: &program
- time-distribution:
type: RandomDiracComb
parameters: [*minfreq, *maxfreq]
type: Event
actions:
- type: RunProtelisProgram
parameters: ["1", *retain]
- time-distribution: null
program: send
- pool: &program2
- time-distribution: 1
program: tomacs
- time-distribution: null
program: send
- pool: &move
- time-distribution: 10
type: Event
actions:
- type: MoveToTarget
parameters: [target, *speed]
deployments:
- type: Rectangle
parameters: [*n, 0, 0, *w, *h]
contents:
- molecule: time
concentration: *time
- molecule: speed
concentration: *speed
- molecule: small
concentration: *small
programs:
- *program
- *move
From the showcase
Optimal resilient distributed data collection in mobile edge environments
Navigate along the streets
Moves along the available paths, depending on the specific vehicle being used.
Requires actual geo-spatial information.
This kind of navigation can be realized using
TargetMapWalker
.
Reproduce a GPS Trace
Ignores the map geospatial information and relies on a GPS trace instead,
starting from its first position and reaching the last,
navigating from point to point in “straight lines”
(on maps, these are actually orthodromes).
This kind of navigation can be realized using
ReproduceGPSTrace
.
Deploying nodes using GPS traces
You probably want your nodes to start from the position that marks the beggining of a trace.
We discussed how to do so here.
Time alignment of GPS traces
Navigation with GPS traces usually require that they get correctly aligned with time,
especially if they come from samples taken at different times.
We discussed the alignment of GPS traces here,
the same alignment system used for importing traces is used for using them during navigation.
Examples
Click to show / hide code
environment:
type: OSMEnvironment
parameters: ["vcm.pbf", false] # Requires the file vcm.pbf in the classpath!
incarnation: sapere
_pools:
- pool: &move
- time-distribution: 0.1
type: Event
actions:
- type: ReproduceGPSTrace
parameters: ["gpsTrace", true, "AlignToSimulationTime"]
deployments:
- type: FromGPSTrace
parameters: [7, "gpsTrace", true, "AlignToSimulationTime"]
programs:
- *move
terminate:
type: StableForSteps
parameters:
equalIntervals: 5
checkInterval: 100
Interpolate GPS traces with street data
Navigates along a GPS trace, but computes the point-to-point distance using the navigation system,
rather than “straight lines” (orthodromes).
This kind of navigation can be realized using
GPSTraceWalker
.