No description
Find a file
Fabian Missbrenner 5f2dfbef5c Add CLAUDE.md with project conventions for Claude Code
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 15:52:36 +01:00
.forgejo/workflows Record R (package) versions for reproducibility purposes (#14) 2025-09-12 13:58:39 +00:00
cache Switch to 'visited in time bin' metric (#12) 2025-09-11 11:31:28 +00:00
doc Fix animations 2025-09-15 17:25:22 +02:00
graphics/6 Record R (package) versions for reproducibility purposes (#14) 2025-09-12 13:58:39 +00:00
lib De-clutter file structure and enable CI (#2) 2025-08-27 11:16:55 +00:00
out Switch to 'visited in time bin' metric (#12) 2025-09-11 11:31:28 +00:00
src Record R (package) versions for reproducibility purposes (#14) 2025-09-12 13:58:39 +00:00
.1_session-info.txt Record R (package) versions for reproducibility purposes (#14) 2025-09-12 13:58:39 +00:00
.2_session-info.txt Record R (package) versions for reproducibility purposes (#14) 2025-09-12 13:58:39 +00:00
.3_session-info.txt Record R (package) versions for reproducibility purposes (#14) 2025-09-12 13:58:39 +00:00
.4_session-info.txt Record R (package) versions for reproducibility purposes (#14) 2025-09-12 13:58:39 +00:00
.5_session-info.txt Record R (package) versions for reproducibility purposes (#14) 2025-09-12 13:58:39 +00:00
.6_session-info.txt Record R (package) versions for reproducibility purposes (#14) 2025-09-12 13:58:39 +00:00
.gitattributes Summarise work for DyMoNet meeting in Turin (#15) 2025-09-15 15:20:18 +00:00
.gitignore Switch to 'visited in time bin' metric (#12) 2025-09-11 11:31:28 +00:00
.gitmodules De-clutter file structure and enable CI (#2) 2025-08-27 11:16:55 +00:00
1-AoI_Raster.html Make notebooks distinguishable by name 2025-09-04 16:52:37 +02:00
1-AoI_Raster.Rmd Record R (package) versions for reproducibility purposes (#14) 2025-09-12 13:58:39 +00:00
2-Per-Cell_AoI.html Make notebooks distinguishable by name 2025-09-04 16:52:37 +02:00
2-Per-Cell_AoI.Rmd Record R (package) versions for reproducibility purposes (#14) 2025-09-12 13:58:39 +00:00
3-Parameter_Study.Rmd Record R (package) versions for reproducibility purposes (#14) 2025-09-12 13:58:39 +00:00
4-Required_Penetration.html Make notebooks distinguishable by name 2025-09-04 16:52:37 +02:00
4-Required_Penetration.Rmd Record R (package) versions for reproducibility purposes (#14) 2025-09-12 13:58:39 +00:00
5-Cell_Reachability.html Switch to 'visited in time bin' metric (#12) 2025-09-11 11:31:28 +00:00
5-Cell_Reachability.Rmd Record R (package) versions for reproducibility purposes (#14) 2025-09-12 13:58:39 +00:00
6-No_AoI.html Switch to 'visited in time bin' metric (#12) 2025-09-11 11:31:28 +00:00
6-No_AoI.Rmd Record R (package) versions for reproducibility purposes (#14) 2025-09-12 13:58:39 +00:00
CLAUDE.md Add CLAUDE.md with project conventions for Claude Code 2026-02-17 15:52:36 +01:00
Containerfile Switch to 'visited in time bin' metric (#12) 2025-09-11 11:31:28 +00:00
envmon.sif Switch to 'visited in time bin' metric (#12) 2025-09-11 11:31:28 +00:00
envmon.sumocfg De-clutter file structure and enable CI (#2) 2025-08-27 11:16:55 +00:00
Makefile Switch to 'visited in time bin' metric (#12) 2025-09-11 11:31:28 +00:00
parallel.sbatch Switch to 'visited in time bin' metric (#12) 2025-09-11 11:31:28 +00:00
README.md Add README with setup, pipeline, and usage documentation 2026-02-17 15:51:32 +01:00
VERSIONS Record R (package) versions for reproducibility purposes (#14) 2025-09-12 13:58:39 +00:00

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
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.