Skip to content

Latest commit

 

History

History
49 lines (41 loc) · 2.13 KB

File metadata and controls

49 lines (41 loc) · 2.13 KB

SimOpt — Genetic Algorithm Construction Site Optimizer

Optimizes vehicle scheduling (excavators, dirt trucks, material trucks, cranes) on a construction site grid using a genetic algorithm. Tightly integrated with deVision for scene definition and result visualization.

Companion repo

/home/sisa/Studium/Praktikum/deVision (branch: simOpt) — provides scene geometry and visualizes results.

Key files

  • sim/scenefile.goLoadGridFromScene(): builds Grid from simopt-scene-v1 JSON (replaces heightmap PNG)
  • sim/roadnetwork.goRoadGraph, LoadRoadNetwork(), RouteViaRoad() (A→road→A)
  • sim/grid.goGrid, AStarForVehicle()
  • sim/vehicle.goBaseVehicle, PathfindToViaRoad(), RetryPathfindViaRoad()
  • sim/simulation.goSimulation, NewSimulation(g, work, rg)
  • cmd/worker/main.go — worker binary entry point
  • ga_results/best_schedule.json — real GA result (gen 85, fitness 4218s, 20 vehicles)

Worker flags

./worker --simopt-scene <path>    # replaces --heightmap; required if no --heightmap
         --heightmap <path>       # legacy PNG heightmap
         --road-network <path>    # optional; enables road-following routing
         --fast                   # headless mode, no renderer

Scene file format (simopt-scene-v1)

Written by deVision ExportSimOptScene pipeline. Contains:

  • Grid dimensions, origin, metersPerCell
  • passable[], excavate[], pipePlacement[] flat bool arrays (row-major)
  • spawnCol, spawnRow

Road network format (road-network-v1)

Written by deVision ExportRoadNetwork pipeline. Contains:

  • transform: {originX, originZ, metersPerCell} — maps deVision world coords to grid cells
  • paths[]: spline point arrays from deVision drive paths

Best schedule format

{
  "generation": 85,
  "fitness_seconds": 4218.46,
  "num_excavators": 8, "num_dirt_trucks": 8,
  "material_truck_count": 3, "crane_count": 1,
  "schedule": { "<timeSeconds>": ["vehicle_type", ...] }
}

What's next

  • Per-vehicle path/waypoint export so deVision can animate vehicle movement
  • SimOpt scenario bundle (scene + road network + schedule in one file)