File size: 1,775 Bytes
1c6e7aa
cb054fe
 
 
 
1c6e7aa
cb054fe
1c6e7aa
 
cb054fe
 
1c6e7aa
 
cb054fe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
title: Overflow OpenENV
emoji: 🚗
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
tags:
  - openenv
---

# Overflow Environment

An autonomous vehicle fleet oversight environment for [OpenEnv](https://github.com/meta-pytorch/OpenEnv).

## Overview

A 2D road grid with N cars. One car (Car 0) is controlled by an LLM agent, while other cars follow simple scripted driving rules. An observer detects crashes and near-misses each step and computes rewards based on safety.

## Quick Start

```bash
# Install dependencies
pip install -e .

# Run the server
uvicorn server.app:app --host 0.0.0.0 --port 8000 --reload
```

```python
from overflow_env import OverflowEnv, OverflowAction

async with OverflowEnv(base_url="http://localhost:8000") as env:
    result = await env.reset()
    print(result.observation.scene_description)

    action = OverflowAction(decision="maintain", reasoning="Road is clear ahead.")
    result = await env.step(action)
    print(result.observation.incident_report)
    print(f"Reward: {result.reward}, Done: {result.done}")
```

## Action Space

| Decision | Effect |
|----------|--------|
| `accelerate` | Increase speed by 5 |
| `brake` | Decrease speed by 5 |
| `lane_change_left` | Move to left lane |
| `lane_change_right` | Move to right lane |
| `maintain` | Keep current speed and lane |

## Reward Structure

| Event | Reward |
|-------|--------|
| Crash (distance < 5) | -5.0 |
| Near miss (distance < 15) | -1.0 |
| Safe step toward goal | +0.5 |
| Reached goal | +3.0 |
| Reasoning quality bonus | +0.0 to +0.3 |

## Environment Details

- **Road**: 3 lanes, ~200 units long
- **Cars**: 5 total (1 agent + 4 scripted)
- **Max steps**: 100 per episode
- **Speed range**: 20–90 units