Maneuver.Map
Maneuver.Map orchestrates multi‑generation experiments, evolves Gossamer parameters, runs Leviathan simulations, writes data to GCS, and renders a performant 3D view in the browser.
How It Fits With Gossamer + Leviathan
- Controls Leviathan runs and exposes APIs for scheduling, listing, slicing frames, and visualization.
- Uses Gossamer algorithms during runs to compute agent actions and metrics.
- Outputs CSV/Parquet and metadata for archival and analysis.
Typical Workflow
- Generate data by running experiments via the orchestrator; Leviathan writes CSV (or Parquet via converter).
- Orchestrator Web (FastAPI):
- Local run:
cd backend pip install -r requirements.txt # Ensure Leviathan bindings are importable and Gossamer installed cp .env.example .env uvicorn app.main:app --reload # Visit http://127.0.0.1:8000 - Docker (Cloud‑ready):
cd backend docker build -t gcr.io/<PROJECT_ID>/maneuver-map-orchestrator:latest . docker push gcr.io/<PROJECT_ID>/maneuver-map-orchestrator:latest
- Local run:
- Quickstart (CLI): Render an interactive HTML from Leviathan CSV output.
pip install -r requirements.txt python viz.py /path/to/leviathan_output.csv --out swarm.html - Explore Visualization:
- React UI (Three.js) with time slider; data served by
/framesAPI. - Local UI dev:
cd frontend-react npm install cp .env.example .env # set VITE_API_BASE to orchestrator URL if needed npm run dev
- React UI (Three.js) with time slider; data served by
Cloud Storage Integration
- Provide
gcs_bucketandgcs_prefixinPOST /experimentsto upload outputs and metadata togs://<bucket>/<prefix>/<experiment_id>/....
API Quick Reference
GET /health,GET /estimatePOST /experimentsfields:name, steps, num_agents, dt, generations, output_frequency, optimize, objective, population_size, eval_steps, repeats, parallelism, early_stopping_*, environment_preset|target_body|environment_bound, start_utc, duration_sec, spice_kernels[], ephem_center, ephem_frame, ephem_abcorr, ephem_step_sec, gcs_bucket, gcs_prefixGET /experiments,GET /experiments/{id}GET /frames?exp_id&gen_index&start&end&stride&max_points
Scheduler Parameters
Use the Schedule Experiment modal in the UI to launch runs. Below is what each input controls and how it maps to the backend.
Core Settings
- Name: Label for the run; stored in
experiment.jsonasnameand used when uploading to GCS. - Steps: Total simulation steps per generation (
steps). Higher values produce longer runs and more frames. - Agents: Number of simulated agents/particles (
num_agents). Affects compute cost roughly linearly. - dt: Physics time step in seconds (
dt). Smallerdtmeans finer integration; increases step count for a fixed real time. - Generations: How many full runs to execute sequentially (
generations). Each generation has its owngen-XXXoutput directory. - Output freq: Write frames every N steps (
output_frequency). Lower values write more frames and larger outputs; higher values decimate output.
Algorithm
- Algorithm: Selects the control policy used during the simulation (
algorithm). Options:flocking: Baseline boids-like control using Gossamer flocking metrics.iccd: Intent-aware communications + contact delay simplification. Adds agent attributes like AoI and SoC.dmb: Density‑Modulated Boids; adapts flock weights based on local density.tf_aco: Terrain/Field Ant Colony Optimization; coverage-biased motion using a pheromone grid.dmb_tf_aco: Hybrid of DMB and TF‑ACO.hma_market: Macro‑micro construction logistics; uses role/task structures (haulers, printers, micro agents).
- Algorithm params (JSON): Merged into the request to configure algorithm components. Common keys include:
flock_params:{ alignment_weight, cohesion_weight, separation_weight, neighbor_radius, separation_distance, max_speed }— base weights and limits.dmb:{ alpha, beta, d0, d1, neighbor_radius, separation_distance, max_speed }— schedules weights vs. density.tfaco:{ grid_resolution, pheromone_evap_lambda, deposit_rate, heuristic_weight, max_grid }— pheromone grid and exploration.iccd:{ initial_aoi, relay_rotation }— AoI baseline and relay rotation behavior.dtn:{ contact_density, bandwidth_kbps, one_way_delay_sec, custody_transfer }— simplified delay‑tolerant network.energy:{ soc_wh }— initial state of charge wh per agent.agents: e.g.,{ micro: { count }, macro: { haulers, printers } }— agent role counts for HMA.depots:{ count }— number of depots for HMA logistics.hma: role/task tunables (if any) used by HMA flows.obstacles:{ field: true, strength, range, count }— optional potential‑field repulsion for hazard avoidance.
Effects during the run:
flockingweights drive accelerations directly each step.dmbcomputes global/approximate density and adjusts weights on the fly.tf_acoconstructs a pheromone grid over X‑Y; agents bias motion toward low‑pheromone cells with evaporation.iccdanddtnadd per‑agent attributes (AoI, SoC, density) and simple communications effects.hmaassigns roles and simple depot→printer flows, accumulating printed material metrics.
Parameter Sweeps
- Sweeps (JSON): Submits a Cartesian sweep of parameters to
/experiments/sweep. Keys can be dotted paths into the request, e.g.{ "dmb.neighbor_radius": [100,300,500] }. The backend schedules one run per combination in the background.
Environment & Ephemerides
- Environment preset: Predefined environment that may set a domain bound and optional SPICE fields (e.g.,
mars,ceres). - Target body: Body name for ephemerides (
target_body). - Start UTC: Start of the ephemerides window (
start_utc, ISO8601 UTC). - Duration (sec): Duration of ephemerides window (
duration_sec). - Kernel URIs: Comma‑separated SPICE kernel URIs/paths (
spice_kernels) — supportsgs://. - Center: Reference center (
ephem_center, e.g.,SUN). - Frame: Reference frame (
ephem_frame, e.g.,J2000). - Aberrations: Corrections (
ephem_abcorr, e.g.,NONE,LT+S). - Step (sec): Sampling step for ephemerides (
ephem_step_sec).
When provided, ephemerides are computed and embedded in experiment.json under environment.meta.ephemerides, and the visualization can overlay them. The environment bound may be suggested from the max radius.
Optimization (Evolution)
- Optimize (evolution): Enables evolutionary search before running a final best experiment (
optimize=true). - Population: Candidates per generation (
population_size). - Eval steps: Steps per candidate evaluation (
eval_steps). - Parallelism: Concurrent candidate evaluations (
parallelism).
Defaults used internally when not exposed in the modal:
selection_fraction0.5,mutation_rate0.3,crossover_rate0.7,early_stopping_patience3,early_stopping_delta1e-6,repeats1,seed_base42.
Output & Storage
- Frames are written every
output_frequencysteps. The orchestrator emits Parquet parts by default alongside CSV; the viewer reads via/frameswhich streams from Parquet when available. - If
DEFAULT_GCS_BUCKET/PREFIXare configured on the backend, completed runs are uploaded automatically. The UI can also list recent GCS runs and hydrate them for local viewing.
Last updated on