|
|
||
|---|---|---|
| .forgejo/workflows | ||
| cache | ||
| doc | ||
| graphics/6 | ||
| lib | ||
| out | ||
| src | ||
| .1_session-info.txt | ||
| .2_session-info.txt | ||
| .3_session-info.txt | ||
| .4_session-info.txt | ||
| .5_session-info.txt | ||
| .6_session-info.txt | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| 1-AoI_Raster.html | ||
| 1-AoI_Raster.Rmd | ||
| 2-Per-Cell_AoI.html | ||
| 2-Per-Cell_AoI.Rmd | ||
| 3-Parameter_Study.Rmd | ||
| 4-Required_Penetration.html | ||
| 4-Required_Penetration.Rmd | ||
| 5-Cell_Reachability.html | ||
| 5-Cell_Reachability.Rmd | ||
| 6-No_AoI.html | ||
| 6-No_AoI.Rmd | ||
| CLAUDE.md | ||
| Containerfile | ||
| envmon.sif | ||
| envmon.sumocfg | ||
| Makefile | ||
| parallel.sbatch | ||
| README.md | ||
| VERSIONS | ||
envmon
R-based geospatial analysis of Age of Information (AoI) in vehicular sensor networks. Uses SUMO traffic simulation traces from the Luxembourg LuST scenario to study how well moving vehicles can keep grid cells up-to-date with sensor readings (e.g. CO2 pollution). The core question: what penetration rate of sensor-equipped vehicles is needed to maintain fresh information across a city grid?
Prerequisites
| Dependency | Notes |
|---|---|
| R 4.x | The container uses ghcr.io/rocker-org/geospatial:4; local installs need the packages listed in the Containerfile |
| Podman (or Docker) | For containerised builds; skip if using LOCAL_R=1 |
| Git LFS | Large data files (Parquet, RData, shapefiles, HTML) are tracked via LFS |
| csv2parquet | From domoritz/arrow-tools — used in the data pipeline |
| SUMO 1.8.0 | Bundled as the lib/sumo submodule |
Getting Started
# Clone with submodules
git clone --recurse-submodules https://code.fabimi.net/luna/envmon
cd envmon
# Pull LFS objects
git lfs install
git lfs pull
Container (recommended)
make container.exists # build the Podman image
make 1-AoI_Raster.html # render a notebook inside the container
Local R
Install the R packages listed in the Containerfile, then prefix commands with LOCAL_R=1:
LOCAL_R=1 make 6-No_AoI.html
Data Pipeline
The trace data is produced in three sequential steps (each target depends on the previous):
SUMO simulation ──► FCD XML ──► CSV ──► Parquet
make out/envmon.fcd.xml # 1. Run SUMO → Floating Car Data XML
make out/envmon.csv # 2. xml2csv.py → semicolon-delimited CSV
make cache/envmon.parquet # 3. csv2parquet → Parquet (used by notebooks)
Analysis Notebooks
| # | File | Purpose | Key Parameters |
|---|---|---|---|
| 1 | 1-AoI_Raster.Rmd |
Single-vehicle AoI visualisation on a raster grid | frame_duration |
| 2 | 2-Per-Cell_AoI.Rmd |
Per-cell AoI for sampled vehicle subsets | penetration_rate |
| 3 | 3-Parameter_Study.Rmd |
Sweep across penetration rates and repetitions (parallel via future.apply) |
repetitions, penetration_rates, no_workers |
| 4 | 4-Required_Penetration.Rmd |
Determine the required penetration rate | (loads pre-computed results) |
| 5 | 5-Cell_Reachability.Rmd |
Grid cell reachability analysis | sample_size, time windows |
| 6 | 6-No_AoI.Rmd |
Visit-based metric without AoI calculation | slot_width, penetration_rate |
Rendering
make 3-Parameter_Study.html # container (default)
LOCAL_R=1 make 3-Parameter_Study.html # local R
# Custom parameters
R --vanilla -e 'rmarkdown::render("2-Per-Cell_AoI.Rmd", params=list(penetration_rate=0.001))'
Extracting a standalone R script
make 3-Parameter_Study.R # runs knitr::purl() to extract R code
Batch Processing (SLURM)
src/run-aoi.R is a standalone CLI for computing AoI on an HPC cluster:
Rscript src/run-aoi.R \
--penetration_rate 0.01 \
--repetition 1 \
--cell_size 200 \
--crs 32632 \
--busy_start 28800 --busy_end 32400 \
--calm_start 57600 --calm_end 61200
Only --penetration_rate is required; the rest have sensible defaults. Output goes to out/{SLURM_ARRAY_JOB_ID}/{SLURM_ARRAY_TASK_ID}/ on a cluster, or out/local/{UUID}/ for local runs. Each run produces aoi.parquet, grid.shp, and session-info.txt.
See parallel.sbatch for the SLURM array job template.
Project Structure
.
├── 1-AoI_Raster.Rmd … 6-No_AoI.Rmd # analysis notebooks
├── Makefile # build automation
├── Containerfile # Podman/Docker image definition
├── VERSIONS # pinned tool versions
├── envmon.sumocfg # SUMO simulation config
├── parallel.sbatch # SLURM batch script
├── src/
│ ├── helpers.R # shared functions (load, grid, AoI pipeline)
│ └── run-aoi.R # standalone CLI for batch AoI computation
├── cache/ # cached data (Parquet, RData, shapefiles)
├── out/ # pipeline outputs and batch results
├── lib/
│ ├── sumo/ # SUMO v1_8_0 (git submodule)
│ └── LuSTScenario/ # Luxembourg traffic scenario (git submodule)
├── graphics/ # generated figures, organised by notebook
└── doc/ # presentations
CI
Forgejo Actions renders all six notebooks with reduced parameters on every pull request and uploads the HTML output as artifacts.