The Advanced Locomotive Technology and Rail Infrastructure Optimization System (ALTRIOS) is a unique, fully integrated, open-source software tool to evaluate strategies for deploying advanced locomotive technologies and associated infrastructure for cost-effective decarbonization. ALTRIOS simulates freight-demand driven train scheduling, mainline meet-pass planning, locomotive dynamics, train dynamics, energy conversion efficiencies, and energy storage dynamics of line-haul train operations. Because new locomotives represent a significant long-term capital investment and new technologies must be thoroughly demonstrated before deployment, this tool provides guidance on the risk/reward tradeoffs of different technology rollout strategies. An open, integrated simulation tool is invaluable for identifying future research needs and making decisions on technology development, routes, and train selection. ALTRIOS was developed as part of a collaborative effort by a team comprising The National Renewable Energy Laboratory (NREL), University of Illinois Urbana-Champaign (UIUC), Southwest Research Institute (SwRI), and BNSF Railway.
Add to PATH
option during installation.python3.10 -m venv altrios-venv
in your terminal enviroment (we recommend PowerShell in Windows, which comes pre-installed). This tells Python 3.10 to use the venv
module to create a virtual environment (which will be ignored by git if named altrios-venv
) in the ALTRIOS/altrios-venv/
.source altrios-venv/bin/activate
altrios-venv/Scripts/activate.bat
in a windows command prompt or power shell or source ./altrios-venv/scripts/activate
in git bash terminal(altrios-venv)
.conda create -n altrios python=3.10
to create an Anaconda environment named altrios
.conda activate altrios
.With your Python environment activated, run pip install altrios
.
Congratulations, you've completed installation! Whenever you need to use ALTRIOS, be sure to activate your python environment created above.
Clone the repository:
<USER_HOME>/Documents/altrios_project/
.git clone https://github.com/NREL/ALTRIOS.git
.Within the ALTRIOS folder, run pip install -e ".[dev]"
If you want to use pinned package versions to make sure you're environment is the same as the developers, you can do:
shell
pip install -r requirements-dev.txt
If you add a new package as a dependency, you should update the pinned requirements files.
To do this you can install pip tools: pip install pip-tools
and then:
shell
pip-compile && pip-compile requirements-dev.in
This will generate two files: requirements.txt
and requirements-dev.txt
which you can check into the repository.
Install Rust: https://www.rust-lang.org/tools/install.
There is a shortcut for building and running all tests, assuming you've installed the python package with develop mode. In the root of the ALTRIOS/
folder, run the build_and_test.sh
script. In Windows bash (e.g. git bash), run sh build_and_test.sh
, or in Linux/Unix, run ./build_and_test.sh
. This builds all the Rust code, runs Rust tests, builds the Python-exposed Rust code, and runs the Python tests.
Run maturin develop --release
. Note that not including --release
will cause a significant computational performance penalty.
Whenever updating code, always run cargo test --release
inside ALTRIOS/rust/
to ensure that all tests pass. Also, be sure to rebuild the Python API regularly to ensure that it is up to date. Python unit tests run with python -m unittest discover
in the root folder of the git repository.
To release the package, you can follow these steps:
v<major>.<minor>.<patch>
. For example v0.2.1
.pyproject.toml
file.With your activated Python environment with ALTRIOS fully installed, you can run several scripts in ALTRIOS/applications/demos/
.
You can run the Simulation Manager through a multi-week simulation of train operations with ALTRIOS/applications/demos/sim_manager_demo.py
by running python sim_manager_demo.py
in ALTRIOS/applications/demos/
. This will create a plots
subfolder in which the plots will be saved. To run interactively, fire up a Python IDE (e.g. VS Code, Spyder), and run the file. If you're in VS Code, you can run the file as a virtual jupyter notebook because of the "cells" that are marked with the # %%
annotation. You can click on line 2, for example, and hit <Shift> + <Enter>
to run the current cell in an interactive terminal (which will take several seconds to launch) and advance to the next cell. Alternatively, you can hit <Ctrl> + <Shift> + p
to enable interactive commands and type "run current cell".
The ALTRIOS Team would like to thank ARPA-E for financially supporting the research through the LOCOMOTIVES program and Dr. Robert Ledoux for his vision and support. We would also like to thank the ARPA-E team for their support and guidance: Dr. Apoorv Agarwal, Mirjana Marden, Alexis Amos, and Catherine Good. We would also like to thank BNSF for their cost share financial support, guidance, and deep understanding of the rail industry’s needs. Additionally, we would like to thank Jinghu Hu for his contributions to the core ALTRIOS code. We would like to thank Chris Hennessy at SwRI for his support. Thank you to Michael Cleveland for his help with developing and kicking off this project.