PortSimEnv v1: tasks, source calls, eval rollouts
Browse files- README.md +109 -0
- calls/train.parquet +3 -0
- rollouts/eval.parquet +3 -0
- tasks/eval.parquet +3 -0
- tasks/train.parquet +3 -0
README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-sa-4.0
|
| 3 |
+
pretty_name: PortSimEnv v1
|
| 4 |
+
language: [en]
|
| 5 |
+
task_categories: [reinforcement-learning, text-generation]
|
| 6 |
+
tags: [openenv, rl-environment, simulation, logistics, scheduling, operations-research, berth-allocation, real-world-data]
|
| 7 |
+
size_categories: [1K<n<10K]
|
| 8 |
+
configs:
|
| 9 |
+
- config_name: tasks
|
| 10 |
+
default: true
|
| 11 |
+
data_files:
|
| 12 |
+
- split: train
|
| 13 |
+
path: tasks/train.parquet
|
| 14 |
+
- split: eval
|
| 15 |
+
path: tasks/eval.parquet
|
| 16 |
+
- config_name: rollouts
|
| 17 |
+
data_files:
|
| 18 |
+
- split: eval
|
| 19 |
+
path: rollouts/eval.parquet
|
| 20 |
+
- config_name: calls
|
| 21 |
+
data_files:
|
| 22 |
+
- split: train
|
| 23 |
+
path: calls/train.parquet
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
# PortSimEnv v1
|
| 27 |
+
|
| 28 |
+
Re-plan container-ship dockings at the Port of Barcelona. Each task is a real week (or two or three) at one container
|
| 29 |
+
quay, built from the port's own 2024 records, with disruptions added: late and bunched ships, closed quay sections,
|
| 30 |
+
crane breakdowns, gales under the port's wind rules, traffic diverted from the other terminal, emergencies and priority
|
| 31 |
+
cargo. The agent decides when and where each ship docks and with how many cranes, and is graded once, deterministically,
|
| 32 |
+
against the plan a CP-SAT solver proved optimal.
|
| 33 |
+
|
| 34 |
+
| | |
|
| 35 |
+
|---|---|
|
| 36 |
+
| Environment (OpenEnv Space, 3D viewer, eval explorer) | [FineEnvs/PortSimEnv](https://huggingface.co/spaces/FineEnvs/PortSimEnv) |
|
| 37 |
+
| Article | [Simulation RL Environments](https://huggingface.co/spaces/FineEnvs/simulation-rl-environments) |
|
| 38 |
+
| Bucket (3D twin data, raw eval rollouts) | [FineEnvs/PortSimEnv](https://huggingface.co/buckets/FineEnvs/PortSimEnv) |
|
| 39 |
+
| Code | [adithya-s-k/FineEnvs](https://github.com/adithya-s-k/FineEnvs) |
|
| 40 |
+
| Ideas for v2, v3, post-training, data | [GitHub Discussions](https://github.com/adithya-s-k/FineEnvs/discussions/36) |
|
| 41 |
+
|
| 42 |
+
## Configs
|
| 43 |
+
|
| 44 |
+
| config | split | rows | what |
|
| 45 |
+
|---|---|---|---|
|
| 46 |
+
| `tasks` | `train` | 1,050 | training tasks |
|
| 47 |
+
| `tasks` | `eval` | 50 | held-out tasks: whole week groups that never appear in train |
|
| 48 |
+
| `rollouts` | `eval` | 300 | 6 models x 50 eval tasks: transcript, tool calls, final plan, grade |
|
| 49 |
+
| `calls` | `train` | 1,784 | the 2024 container calls at quays 36A (BEST) and 24B (APM Terminals) the tasks are built from |
|
| 50 |
+
|
| 51 |
+
**tasks**: `system_prompt` and `situation` are exactly what the environment sends (the rules, then the opening
|
| 52 |
+
message, which is also what `get_situation()` returns). `task` is the full task as JSON (ships, closures, disruptions,
|
| 53 |
+
rules). `optimal_plan` / `optimal_cost` are the CP-SAT reference (`proven_optimal` says whether optimality was
|
| 54 |
+
proven); `naive_plan` / `naive_cost` re-plan by pushing ships later. A plan is a JSON list of
|
| 55 |
+
`{"ship": id, "berth_hour": h, "section": s, "cranes": c}`.
|
| 56 |
+
|
| 57 |
+
**rollouts**: one row per (model, task) from the eval run `dock-eval50`: 12 turns and 32k output tokens per turn,
|
| 58 |
+
the same three tools. `messages` is the full transcript, `steps` the tool calls with each `check_plan` result,
|
| 59 |
+
`grade` the final grade.
|
| 60 |
+
|
| 61 |
+
## Results on the 50 eval tasks
|
| 62 |
+
|
| 63 |
+
| model | mean reward | standard | busy | storm | extreme | submitted | valid | optimal |
|
| 64 |
+
|---|---|---|---|---|---|---|---|---|
|
| 65 |
+
| GPT-6.1 Sol | **0.888** | 1.00 | 0.90 | 0.86 | 0.82 | 50 | 50 | 26 |
|
| 66 |
+
| Claude Sonnet 5.5 | **0.782** | 0.92 | 0.80 | 0.68 | 0.77 | 49 | 49 | 10 |
|
| 67 |
+
| GLM-5.3-Flash | **0.470** | 0.77 | 0.50 | 0.46 | 0.24 | 36 | 25 | 9 |
|
| 68 |
+
| Qwen3.8-2.4T | **0.380** | 0.58 | 0.45 | 0.33 | 0.21 | 34 | 23 | 5 |
|
| 69 |
+
| GLM-5.3 | **0.313** | 0.62 | 0.34 | 0.22 | 0.15 | 17 | 16 | 10 |
|
| 70 |
+
| Qwen3.8-27B | **0.211** | 0.40 | 0.27 | 0.22 | 0.00 | 16 | 13 | 3 |
|
| 71 |
+
|
| 72 |
+
## Reward
|
| 73 |
+
|
| 74 |
+
Deterministic, no LLM judge. A plan that breaks any rule scores at most 0.2 (0.2 x the share of ships placed cleanly).
|
| 75 |
+
A valid plan's cost (hours each ship leaves after its due time x its size x its priority, plus penalties for late
|
| 76 |
+
emergency dockings and moved ships) is compared with the optimum:
|
| 77 |
+
`gap = (cost - optimum) / (optimum - unavoidable + 100)`, `reward = 0.2 + 0.8 * exp(-gap / 0.5)`. No submission
|
| 78 |
+
scores 0.
|
| 79 |
+
|
| 80 |
+
## Use
|
| 81 |
+
|
| 82 |
+
```python
|
| 83 |
+
import json
|
| 84 |
+
from datasets import load_dataset
|
| 85 |
+
|
| 86 |
+
tasks = load_dataset("FineEnvs/PortSimEnv", "tasks", split="eval")
|
| 87 |
+
task = tasks[0]
|
| 88 |
+
print(task["system_prompt"], task["situation"], sep="\n\n")
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
Every task can be played on the environment Space (OpenEnv; MCP tools `get_situation`, `check_plan`,
|
| 92 |
+
`submit_plan`). Submitting the reference optimum scores 1.0:
|
| 93 |
+
|
| 94 |
+
```python
|
| 95 |
+
from openenv.core.env_server.mcp_types import CallToolAction
|
| 96 |
+
from openenv.core.mcp_client import MCPToolClient
|
| 97 |
+
|
| 98 |
+
env = MCPToolClient("https://fineenvs-portsimenv.hf.space").sync()
|
| 99 |
+
env.reset(task_id=task["task_id"])
|
| 100 |
+
step = env.step(CallToolAction(tool_name="submit_plan", arguments={"plan": json.loads(task["optimal_plan"])}))
|
| 101 |
+
print(step.reward) # 1.0
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
## Source and licence
|
| 105 |
+
|
| 106 |
+
Contains data from the Port de Barcelona open data portal (https://opendata.portdebarcelona.cat/), via the 2024
|
| 107 |
+
snapshot in [alberto-santini/berth-allocation-problems](https://github.com/alberto-santini/berth-allocation-problems),
|
| 108 |
+
licensed CC BY-SA 4.0. This dataset is shared under the same licence. Crane fleets, wind rules and handling rates come
|
| 109 |
+
from the terminals' and the port's published information; disruptions are generated. Work in progress (v1).
|
calls/train.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:09e19fc6f97c57d300169df425165aabf3346bcddc1850490c04e26ed1deb908
|
| 3 |
+
size 85713
|
rollouts/eval.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:10f0345e470fd7c772b49f76f86f7b1d2d7367c921d1d98fbe1b98992929667d
|
| 3 |
+
size 18674694
|
tasks/eval.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:843c35cdc97635d7c4857feaf81695e0210f0ba4b6c4666e37acb0363f7194a1
|
| 3 |
+
size 363051
|
tasks/train.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:21ef1890e55af6ee3caa02dd6f8d73e8388d00dc6cdd7ba5bf19ec8763e13ba7
|
| 3 |
+
size 5503108
|