Skip to content

jacobigo/simple_fleet_sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Fleet Sim

By Jacob Igo

A from-scratch fleet-dispatch simulation, a lightweight custom sim (plain Python/NumPy)

Greedy matching Hungarian matching
greedy matching visualization hungarian matching visualization

Status

Work in progress, built incrementally in a Socratic/learning-mode style — code is written by hand, not generated, for applied learning.

Done:

  • Baseline matching — N vehicles, M requests on a grid; greedy nearest-vehicle assignment.
  • Stochastic demand — Poisson-process request arrivals with spatial hot zones (per-region rates), wrapped in a round-based timestep simulation loop (Engine).

Planned:

  • Optimal assignment — Hungarian algorithm (scipy.optimize.linear_sum_assignment) as an alternative to greedy matching.
  • Repositioning under uncertainty — compare reactive vs. distribution-aware idle-vehicle repositioning policies via Monte Carlo evaluation (100+ randomized runs).
  • Charging constraint (stretch) — battery/range threshold routes vehicles to charge instead of accepting requests.

Files

  • sim_classes.py — entities (CarAgent, Requester).
  • sim_functions.py — engine-level functions (distance computation, agent spawning, request generation, matching).
  • sim_engine.pyEngine, the timestep orchestrator that owns simulation state and calls into sim_functions each round.
  • sim_data.py — toy region/demand configuration used to construct an Engine.
  • sim_visual.py — live matplotlib view of a running Engine.

Setup

python -m venv .venv
source .venv/bin/activate
pip install numpy scipy matplotlib

To Run

python sim_engine.py

About

Simulation for fleet orchestration for self-driving vehicles, comparing and validating VRP policies for optimal allocation.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages