Access modeling toolkit for Rust built on the RouteE Compass energy-aware route planner.
The Behavior and Advanced Mobility Big Access Model (BAMBAM) is a mobility research platform for scalable access modeling. The process begins with a grid defined at some spatial granularity (e.g., census block or 1 km grid) and a variety of travel configurations. For each grid cell and configuration, the platform executes constrained searches, uses the results to index points of interest (POI), and aggregates the findings to the grid level. It provides researchers access through R or Python running on HPC. The platform automates the import and merging of datasets from a variety of sources including data.gov (with automatic merging of Tiger/Lines geometries), OpenStreetMaps, OvertureMaps, and GTFS. It is built upon RouteE Compass, a scalable, energy-aware route planner written in Rust, extended to model multiple travel modes.
This software is in a beta phase of development.
BAMBAM is provided as either a set of command line tools or via a Python API.
First, install using cargo (via rustup): cargo build --release --manifest-path rust/Cargo.toml. Compilation generates the following command line utilities:
- bambam - runs the access model
- bambam_util - runs specific support utilities
- bambam_gtfs - GTFS analysis and import script
- bambam_osm - OpenStreetMap import script
- bambam_omf - OvertureMaps import script
We can list the command arguments for bambam (will document app as "RouteE Compass"):
$ ./rust/target/release/bambam --help
The RouteE-Compass energy-aware routing engine
Usage: bambam [OPTIONS] --config-file <*.toml> --query-file <*.json>
Options:
-c, --config-file <*.toml> RouteE Compass service configuration TOML file
-q, --query-file <*.json> JSON file containing queries. Should be newline-delimited if chunksize is set
--chunksize <CHUNKSIZE> Size of batches to load into memory at a time
-n, --newline-delimited Format of JSON queries file, if regular JSON or newline-delimited JSON
-h, --help Print help
-V, --version Print version
Install the library, currently unpublished, using pip: pip install -e ".[all]".
Before running any examples, run the following setup command(s) to download example data assets:
$ ./script/setup_test_bambam.sh
$ ./script/setup_test_bambam_osm.shThis test uses drive-mode traversal to report opportunities in the Denver Metro region:
$ RUST_LOG=info ./rust/target/release/bambam --config-file denver_co/denver_test.toml --query-file query/denver_extent.json
or, in Python:
from nrel.bambam import BambamRunner
import pandas
import json
app = BambamRunner.from_config_file("configuration/test_denver.toml")
with open("query/denver_extent.json") as f:
query = json.loads(f.read())
result = app.run(query)This test uses walk-transit traversal to report opportunities near University of Colorado Boulder. First, process the GTFS archive:
$ RUST_LOG=info ./configuration/bambam-gtfs/local-exact-range.shNow run BAMBAM using the boulder_test.toml configuration file and a small study area extent:
$ RUST_LOG=info ./rust/target/release/bambam --config-file configuration/boulder_test.toml --query-file query/boulder_broadway_and_euclid.json- Python API
- R API
- OvertureMaps network import
- methodological improvements for walk/bike/drive realism
- transit-mode travel using GTFS Schedule data networks
- multimodal route planning
Copyright 2025 Alliance for Energy Innovation, LLC
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.