How ramp-project/ramp-mobility works
1. Project purpose and scope
- RAMP-mobility is a Python 3.7 model for generating bottom-up stochastic electric-vehicle mobility and charging load profiles at 1-minute resolution.
- It is not an app or service; it is a simulation pipeline driven by country-specific input files and CSV datasets.
2. High-level architecture
- The repository is organized around a single simulation flow:
- load country and empirical inputs,
- initialize vehicle/mobility state,
- simulate mobility trajectories,
- simulate charging behavior,
- post-process results into outputs.
- The model is split into two conceptual modules: mobility generation and charging simulation.
3. Execution entrypoint and orchestration
- ramp_mobility/ramp_run.py is the main orchestration layer.
- It likely coordinates model setup, parameter selection, running scenarios, and exporting results.
- ramp_mobility/__init__.py makes the package importable as a reusable library.
4. Core simulation engine
- ramp_mobility/core_model/ contains the main computational engine:
- core.py — central model logic and simulation coordination,
- initialise.py — prepares the initial state, likely populating vehicle populations and time-series structures,
- stochastic_process_mobility.py — generates randomized trip/parking behavior,
- charging_process.py — converts mobility states into charging demand.
- This is the main boundary between input data and time-series outputs.
5. Mobility model subsystem
- The mobility subsystem produces vehicle availability, trips, and parking patterns from stochastic rules.
- It consumes precomputed empirical distributions and country-specific assumptions from database/ and the country input files.
- The output of this subsystem is the per-vehicle temporal activity pattern that downstream charging logic uses.
6. Charging model subsystem
- The charging subsystem runs after mobility is known and simulates battery charging at the vehicle level.
- README shows four strategies implemented:
- Uncontrolled
- Perfect Foresight
- Night Charge
- RES Integration
- This subsystem depends on parking availability, charging-point availability, and in the RES case, residual-load information.
7. Country-specific configuration layer
- ramp_mobility/country_input_files/Europe/ contains one Python file per supported country: 28 European countries in total.
- These files act as a parameterization boundary for national assumptions, meaning the same core model is reused across countries with different inputs.
- This is the main place where regional behavior is specialized without changing the core engine.
8. Data layer
- database/ contains the empirical and derived CSV inputs used by the model:
- trip timing distributions (trips_by_time_*.csv),
- vehicle share,
- temperature/population datasets,
- demand and load-related distributions,
- residual load curves per country under database/residual_load/.
- These files are static model resources, not runtime code, and they feed the stochastic generation and smart-charging logic.
9. Post-processing boundary
- ramp_mobility/post_process/post_process.py handles result aggregation and formatting after the simulation.
- This suggests the model produces raw per-vehicle or per-step outputs first, then transforms them into analysis-ready profiles or summaries.
10. Utility/support code
- ramp_mobility/utils.py likely holds shared helper functions used across initialization, model execution, and output handling.
- This is a cross-cutting support layer rather than a primary subsystem.
11. Model inputs and outputs
- Inputs are mostly CSV datasets plus country-specific Python parameter modules.
- Outputs are not shown in the tree, but from the README the intended result is high-resolution EV mobility and charging load profiles for scenario analysis.
12. Repository-level documentation and reproducibility
- docs/getting_started.md provides the user-facing run instructions.
- environment.yml defines the execution environment, indicating the project is intended to be run in a managed Python environment with pinned dependencies.
- VERSION.txt and CHANGELOG.md support release tracking.
13. Key architectural constraint
- The model is designed around national heterogeneity: the core simulation is shared, but behavior is controlled by per-country inputs and country-specific datasets.
- For an architecture diagram, the main boundary to show is: shared stochastic engine in the center, with country/data inputs on one side and charging/load outputs on the other.
Main entry points: core.py Core model · charging_process.py Charging sim · stochastic_process_mobility.py Mobility sim · ramp_run.py Run model
Components 18
Docs & release
User guidance and release metadata.
- README · Project overview and model description.
README.md - Quick start · Run instructions and setup guidance.
docs/getting_started.md - Env spec · Pinned Python environment and dependencies.
environment.yml - Versioning · Release tracking metadata.
VERSION.txt
Entry & orchestration
Top-level run coordination.
- Run model · Main simulation entrypoint and scenario runner.
ramp_mobility/ramp_run.py - Package init · Makes the model importable as a library.
ramp_mobility/__init__.py
Core simulation
Shared stochastic mobility and charging engine.
- Core model · Central simulation coordination.
ramp_mobility/core_model/core.py - Initialise · Builds vehicle populations and simulation state.
ramp_mobility/core_model/initialise.py - Mobility sim · Generates trips, parking, and availability trajectories.
ramp_mobility/core_model/stochastic_process_mobility.py - Charging sim · Converts mobility states into charging demand.
ramp_mobility/core_model/charging_process.py - Utils · Shared helpers used across the pipeline.
ramp_mobility/utils.py
Country & data inputs
Reusable national parameters and empirical CSV resources.
- Europe params · Country-specific parameter modules for 28 European countries.
ramp_mobility/country_input_files/Europe/__init__.py - Country file · Representative national input module.
ramp_mobility/country_input_files/Europe/AT.py - Trip curves · Empirical trip timing distributions by day type.
database/trips_by_time_weekday.csv - Residual load · Country residual-load curves for smart charging.
database/residual_load/residual_load_DE.csv - Fleet data · Vehicle share and demand-related empirical inputs.
database/vehicle_share.csv - Demand data · Additional empirical distributions and population/temperature inputs.
database/temp_ninja_pop_1980-2019.csv
Post-processing
Result aggregation and formatting.
- Post-process · Aggregates raw outputs into analysis-ready profiles.
ramp_mobility/post_process/post_process.py
Connections 20
- README → Run model: documents · Explains how the simulation is executed.
- Quick start → Run model: runs · Provides usage instructions for the entrypoint.
- Env spec → Run model: pins · Defines the execution environment.
- Run model → Core model: orchestrates · Coordinates the end-to-end simulation flow.
- Package init → Run model: exposes · Makes the package importable for running and reuse.
- Core model → Initialise: initializes · Prepares the simulation state.
- Core model → Mobility sim: simulates · Runs the stochastic mobility generation stage.
- Core model → Charging sim: simulates · Runs the charging-demand stage.
- Initialise → Europe params: uses · Loads country-specific model parameters.
- Initialise → Fleet data: uses · Consumes fleet and population input data.
- Mobility sim → Trip curves: uses · Samples from empirical trip timing distributions.
- Mobility sim → Europe params: uses · Applies national mobility assumptions.
- Mobility sim → Country file: uses · Represents per-country specialization.
- Charging sim → Residual load: uses · Uses residual-load information for RES integration.
- Charging sim → Europe params: uses · Reads country-specific charging assumptions.
- Charging sim → Mobility sim: depends on · Consumes mobility and parking availability.
- Charging sim → Demand data: uses · Consumes supporting empirical inputs.
- Core model → Utils: shares · Uses common helper routines.
- Core model → Post-process: hands off · Sends raw outputs to post-processing.
- Post-process → Versioning: packages · Produces finalized outputs for release and analysis.