Installation

LOFT-Sim and LOFT-Edit are maintained as separate repositories but operate as one platform. Install them into the same Python environment and keep their checkouts side by side. This ensures that LOFT-Edit creates network, demand, and configuration files using the exact schema understood by LOFT-Sim.

To run simulations without the editor, the shorter Install the Simulator Only is enough.

Requirements

  • Python 3.12 or newer. Python 3.12 and 3.13 are supported by the current LOFT-Sim package metadata.
  • Git for cloning and updating both repositories.
  • Java 17 or newer, as a full JDK, to run JOSM. The LOFT-Edit launcher builds the editor’s JOSM plugin with the JDK; a Java runtime alone is not enough (see The JOSM plugin jar).
  • JOSM, installed from the official JOSM website. The LOFT-Edit plugin requires JOSM revision 19481 or newer.
  • Internet access for cloning the repositories and downloading the browser Web UI bundle on its first use.

LOFT-Edit runs on Windows, macOS and Linux. Each platform has a launcher in the launchers/ folder of the LOFT-Edit repository.

Install the Simulator Only

The simulator alone needs Python, Git and internet access, but no Java or JOSM. Install it into a virtual environment, so that other Python packages cannot change the simulator’s dependencies:

git clone https://github.com/michigan-traffic-lab/LOFT-Sim.git
cd LOFT-Sim
python3 -m venv .venv           # Python 3.12 or newer; Windows: py -3.13 -m venv .venv
source .venv/bin/activate       # Windows PowerShell: .\.venv\Scripts\Activate.ps1
python -m pip install -e .

The core install contains the simulation engine, the loft-sim command and the server side of the browser viewer. Check that the shipped sample scenario loads:

loft-sim validate -c example/scenarios/sample_demo/config/simulation_config.xml

Run loft-sim from the repository root: the bundled scenarios and example configurations are referenced relative to it. The rest of this page installs LOFT-Edit as well. To add it later, clone LOFT-Edit next to this checkout and continue with Create a Python environment; you can keep the LOFT-Sim clone you already have.

Clone the repositories

Clone LOFT-Sim and LOFT-Edit into the same parent folder:

git clone https://github.com/michigan-traffic-lab/LOFT-Sim.git
git clone https://github.com/michigan-traffic-lab/LOFT-Edit.git

The resulting layout should be:

your-workspace/
  LOFT-Sim/      the simulator
  LOFT-Edit/     the editor

LOFT-Edit looks for a sibling LOFT-Sim checkout automatically. Keeping this layout avoids additional path configuration and makes simulator updates immediately available to the editor.

Create a Python environment

A dedicated virtual environment prevents unrelated Python packages from changing the simulator or editor dependencies. Create it inside LOFT-Edit: the LOFT-Edit launchers find LOFT-Edit/.venv without any configuration.

Windows PowerShell

cd LOFT-Edit
py -3.13 -m venv .venv    # or py -3.12: any installed Python 3.12 or newer
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip

macOS or Linux

cd LOFT-Edit
python3.13 -m venv .venv  # or python3.12: any Python 3.12 or newer
source .venv/bin/activate
python -m pip install --upgrade pip

If you use Conda instead, activate the intended environment before installing both repositories, and select it in the project launcher or with LOFT_EDIT_PYTHON (see Select a different Python interpreter).

Install LOFT-Sim

With the environment active and the two repositories side by side, install the simulator in editable mode. From LOFT-Edit:

python -m pip install -e ../LOFT-Sim

The core installation provides the simulation engine, loft-sim command, and default browser-based Web UI server. Editable installation is recommended because updates pulled into the LOFT-Sim checkout become available without reinstalling the package.

Optional LOFT-Sim components

Install these extras only when you need them. From LOFT-Edit, with the same environment active:

python -m pip install -e "../LOFT-Sim[experiments]"  # plotting for the paper experiment scripts
python -m pip install -e "../LOFT-Sim[all]"          # tests, schema validator, plotting and the legacy desktop viewer

The browser viewer is the default interface and needs no optional extra. Its frontend bundle is downloaded from a GitHub release on first use (currently from the zihaooo/LOFT-Sim-UI repository, where the viewer was first published; loft-sim ui fetch prints the full URL). It can also be prepared explicitly:

loft-sim ui fetch
loft-sim ui status

The viewer’s source is the ui/ folder of the LOFT-Sim repository. To build it from your checkout instead (Node.js 20.19+ or 22.12+, Node 22 LTS recommended), use loft-sim ui build; see Web Viewer Files.

Install LOFT-Edit

Still in LOFT-Edit, with the same environment active, install the editor in editable mode:

python -m pip install -e .

Install LOFT-Sim first. The editor declares loft-sim as a dependency, and the sibling checkout installed in the previous step is what satisfies it; installing the editor first makes pip look for a published loft-sim package instead of your checkout. The editor imports the simulator’s current tag vocabulary, configuration definitions, and schema, so it cannot operate correctly without a compatible simulator installation.

The editor package provides two commands:

Command Purpose
loft-edit The editor’s command-line tools, which the JOSM plugin calls for every file operation. loft-edit doctor is the setup check.
loft-edit-launch The project launcher; the same program the files in launchers/ start.

How LOFT-Edit selects LOFT-Sim

The editor resolves the simulator in this order:

  1. The checkout specified by LOFT_SIM_PATH. It must be the checkout that import loft resolves to; a mismatch is a startup error.
  2. A sibling LOFT-Sim checkout.
  3. The installed loft-sim distribution.

Normally no variable is needed. To bind the editor to a specific checkout for one PowerShell session:

$env:LOFT_SIM_PATH = "C:\path\to\LOFT-Sim"

Use LOFT_SIM_PATH=installed only when the installed distribution is intentionally preferred over any local checkout.

Configure Java and JOSM

Install Java

Install Java 17 or newer, for example the free Eclipse Temurin build. Choose the JDK, not the JRE: the launcher builds the plugin jar with it. Confirm that Java is available:

java -version

Install JOSM

Download JOSM from https://josm.openstreetmap.de/:

  • Windows: the JOSM installer. It installs into your user profile (%LOCALAPPDATA%\JOSM), where the launcher finds it.
  • macOS: the macOS application, moved to /Applications/JOSM.app.
  • Linux: the distribution’s josm package (/usr/share/josm).

On any platform you can instead download josm-tested.jar from the same page and point JOSM_JAR at it.

Set the paths explicitly

The launcher searches common Java and JOSM installation locations. If automatic detection fails, set the paths explicitly before launching. In PowerShell:

$env:JAVA_HOME = "C:\Program Files\Eclipse Adoptium\jdk-21"
$env:JOSM_JAR = "C:\path\to\josm-tested.jar"

On macOS or Linux:

export JAVA_HOME=/path/to/jdk-21
export JOSM_JAR=/path/to/josm-tested.jar

The launcher also recognizes JAVA, JAVAC, JOSM_HOME, and JOSM_APP. Set these only when the normal installation cannot be detected.

The JOSM plugin jar

LOFT-Edit runs inside JOSM as a plugin, plugin/dist/loft-edit.jar in the LOFT-Edit checkout. The jar is not committed to the repository. On the first launch the launcher builds it with the local JDK, and it rebuilds the jar whenever the plugin sources change. To build it by hand:

python plugin/build_plugin.py

LOFT-Edit does not publish a prebuilt loft-edit.jar yet, so a JDK is required: without one the build fails and the launcher stops.

Verify the installation

First verify that the simulator command is available:

loft-sim --help

From the LOFT-Sim repository, validate and run the sample scenario without the GUI. The run simulates one hour, takes about 2 to 3 minutes, and writes its output files to example/scenarios/sample_demo/outputs/:

loft-sim validate -c example/scenarios/sample_demo/config/simulation_config.xml
loft-sim run -c example/scenarios/sample_demo/config/simulation_config.xml --nogui

Then run the editor’s setup check from LOFT-Edit:

loft-edit doctor

The final line should report:

Setup is usable.

This check reports the exact LOFT-Sim checkout imported by Python, verifies every simulator name the editor depends on, and checks that the generated schema, JOSM presets and validator files are current for that simulator. Before the first launch it also warns that the plugin jar has not been built yet; that warning is expected, and the line then reads Setup is usable. followed by the warning count. Do not continue by supplying fallback tag names when this check fails; correct the environment or simulator binding instead.

Launch LOFT-Edit

Start a launcher from the LOFT-Edit checkout:

Platform Launcher
Windows Double-click launchers\loft-edit.cmd, or run it from a terminal.
macOS open launchers/LOFT-Edit.app
Linux launchers/loft-edit.sh. Run launchers/install_linux_desktop_entry.sh once to add a desktop menu entry.
Any loft-edit-launch, with the editor’s environment active.

Every launcher runs the same check as loft-edit doctor first and does not open the editor when the simulator binding is broken, because an editor bound to the wrong simulator writes files the simulator cannot read.

The project launcher allows you to create a synthetic, real-world OSM, or Ann Arbor sample project; open an existing project; select a Python interpreter; check or install missing dependencies; and then open the project in JOSM. JOSM starts with a dedicated profile under runtime/ that carries the plugin, presets, map style and validator rules; your personal JOSM settings are not touched. New projects are created under workspace/ in the LOFT-Edit checkout.

Open the sample project

examples/sample_demo is the maintained Ann Arbor North Campus sample project. Open it with Open Existing Project, or bypass the project launcher and open it directly in JOSM:

loft-edit-launch --josm --scenario examples/sample_demo

The scripts in launchers/ accept the same options, for example launchers\loft-edit.cmd --josm --scenario examples/sample_demo on Windows. Opening the sample this way edits the copy tracked in the repository. To experiment freely, create a new project from Ann Arbor sample project instead. It starts a project under workspace/ from the sample’s network, CNS layer and base map, with empty demand and default configuration.

Select a different Python interpreter

The launchers choose the Python interpreter in this order:

  1. LOFT_EDIT_PYTHON. The previous name, LOFT_AIRSPACE_PYTHON, is still accepted with a deprecation notice.
  2. The interpreter selected in the project launcher, saved in runtime/python_environment.json.
  3. The .venv in the LOFT-Edit checkout, then the .venv in the sibling LOFT-Sim checkout.
  4. Common Anaconda/Miniconda locations, then Python on PATH.

For a temporary Windows override:

$env:LOFT_EDIT_PYTHON = "C:\path\to\env\python.exe"
.\launchers\loft-edit.cmd

On macOS or Linux:

LOFT_EDIT_PYTHON=/path/to/env/bin/python launchers/loft-edit.sh

The interpreter selected in the project launcher is saved for the checkout and reused on later launches. The JOSM plugin runs the editor’s file operations with the same interpreter, so it must have both packages installed; the launcher’s Install Dependencies button installs both checkouts into it.

Update both repositories

The editor and simulator share one vocabulary and should be updated together. From LOFT-Edit:

git -C ../LOFT-Sim pull
git pull
loft-edit doctor

Both packages are editable installs, so a pull takes effect without reinstalling. If either repository changed its dependencies, rerun:

python -m pip install -e ../LOFT-Sim
python -m pip install -e .

When a pull changes the plugin sources, the launcher rebuilds the plugin jar on the next launch.

Troubleshooting

Installation problems, such as a command that is not recognized, the wrong simulator checkout, a failed loft-edit doctor check, or Java and JOSM not being found, are answered under Installation and Setup in Troubleshooting & FAQ.

Next step

Continue to Getting Started to run the sample scenario and see how a scenario is organized. Build your own network and scenario with the End-to-End Workflow in the LOFT-Edit manual.