Skip to the content.

Distributions and mobility

Why this scenario exists

A constant workload flatters a placement policy. Every task of a real edge deployment arrives at its own instant, carries a different payload, and asks for a different amount of CPU, and a moving device changes the access link it pays for. Papers that sweep only constants therefore measure the policy under one point of the workload space.

This scenario runs the same topology twice, first with the file values and then with those values replaced by their stochastic counterparts, so the difference between the two rows is the effect of randomness alone. It is also the demonstration that the configuration can be built from Python: the second run never edits a file, it rewrites the objects returned by load_settings.

What it shows

How to configure a scenario from Python instead of editing the settings files. The settings folder describes constants: every task of an application has the same length, the same sizes, and the same gap between requests, and the devices stand still. This example loads those files, then replaces the constants by probability distributions and lets the devices move.

The distributions live in the pureedgesim package and are also accepted inside the XML files. The example uses them directly:

flowchart LR
    length["task_length<br/>constant MI"] --> lognormal["LogNormal<br/>mean, std = mean / 3"]
    size["request_size<br/>constant KB"] --> weibull["Weibull<br/>shape 1.5, scale = mean / 0.9"]
    rate["rate<br/>requests per minute"] --> exponential["Exponential gap<br/>60 / rate seconds"]
    still["mobility false"] --> gauss["gauss-markov<br/>alpha 0.8, std 15, speed_std 0.4"]
    gauss --> speed["speed<br/>Normal(2.0, 0.5) bounded 0 to 5"]

The scenario

Both runs use examples/distributions_and_mobility/settings with 20 devices, five simulated minutes, the ALL architecture, and random_seed=7. The first run keeps the file values; the second replaces them as described above. Randomness.set_seed and Randomness.begin_scenario make the draws reproducible across the two runs.

The script also prints a few draws before running, so the shape of each distribution is visible without reading the CSV: one gap from the heavy application, and six lognormal task lengths.

Run it

From the repository root, after pip install -e .:

python examples/distributions_and_mobility/distributions_and_mobility.py

What to look for

HEAVY_COMP_APP: every task draws 30000 MI, 2500 KB, gaps of 11.1 s
draws from the lognormal task length: 38135, 18575, 18459, 33461, 38118, 20595
constants, static      tasks= 1035 ok=  751 delay=0.2025   failed(delay)= 284 failed(mobility)=   0 energy=11.5627
distributions, mobile  tasks= 1006 ok=  792 delay=0.2132   failed(delay)= 214 failed(mobility)=   0 energy=10.6488

Replace the gauss-markov model by manhattan, levy-walk, or the other models listed in the README to compare movement patterns under the same workload.

Files

Where to go next