Spaces:
Running on Zero
Running on Zero
Licences: MIT for the code; credit Rijden de Treinen and OpenStreetMap
Browse files
LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2026 Bhavish Pahwa
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
README.md
CHANGED
|
@@ -7,6 +7,7 @@ sdk: gradio
|
|
| 7 |
sdk_version: 6.29.1
|
| 8 |
python_version: "3.12"
|
| 9 |
app_file: app.py
|
|
|
|
| 10 |
pinned: false
|
| 11 |
short_description: Dispatch trains on a real single-track Dutch line
|
| 12 |
tags: [openenv, simulation, rl-environment, railway, scheduling, operations-research]
|
|
@@ -88,11 +89,18 @@ plan = [{"train": "37413", "to": "HDG"}, {"train": "37324", "from": "HDG"}]
|
|
| 88 |
print(env.step(CallToolAction(tool_name="check_plan", arguments={"plan": plan})).observation)
|
| 89 |
```
|
| 90 |
|
| 91 |
-
##
|
|
|
|
|
|
|
| 92 |
|
| 93 |
| data | source | licence |
|
| 94 |
|---|---|---|
|
| 95 |
| trains, timetables, delays, cancellations, platforms; disruptions | [Rijden de Treinen](https://www.rijdendetreinen.nl/en/open-data) open data | CC BY 4.0 ("Rijden de Treinen") |
|
| 96 |
| track layout; the 3D replay's map (track, platforms, buildings, land cover, water, roads) | © OpenStreetMap contributors | ODbL 1.0 |
|
| 97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
The rolling-stock circulation, the disruption effects by cause and the cost weights are modelling choices.
|
|
|
|
| 7 |
sdk_version: 6.29.1
|
| 8 |
python_version: "3.12"
|
| 9 |
app_file: app.py
|
| 10 |
+
license: mit
|
| 11 |
pinned: false
|
| 12 |
short_description: Dispatch trains on a real single-track Dutch line
|
| 13 |
tags: [openenv, simulation, rl-environment, railway, scheduling, operations-research]
|
|
|
|
| 89 |
print(env.step(CallToolAction(tool_name="check_plan", arguments={"plan": plan})).observation)
|
| 90 |
```
|
| 91 |
|
| 92 |
+
## Licences
|
| 93 |
+
|
| 94 |
+
The code is MIT. The data keep their sources' licences:
|
| 95 |
|
| 96 |
| data | source | licence |
|
| 97 |
|---|---|---|
|
| 98 |
| trains, timetables, delays, cancellations, platforms; disruptions | [Rijden de Treinen](https://www.rijdendetreinen.nl/en/open-data) open data | CC BY 4.0 ("Rijden de Treinen") |
|
| 99 |
| track layout; the 3D replay's map (track, platforms, buildings, land cover, water, roads) | © OpenStreetMap contributors | ODbL 1.0 |
|
| 100 |
|
| 101 |
+
The OpenStreetMap-derived data in this Space (the 3D map, `openenv/rail_openenv/web/twin/twin.json.gz`, and the line
|
| 102 |
+
layout inside every task in `tasks/`) is licensed under the [ODbL 1.0](https://opendatacommons.org/licenses/odbl/1-0/),
|
| 103 |
+
not MIT, and stays so when reused or adapted. The 3D replay and the train graph credit OpenStreetMap and Rijden de
|
| 104 |
+
Treinen on screen.
|
| 105 |
+
|
| 106 |
The rolling-stock circulation, the disruption effects by cause and the cost weights are modelling choices.
|
openenv/rail_openenv/web/index.html
CHANGED
|
@@ -39,6 +39,8 @@
|
|
| 39 |
nav.site a:hover { color: var(--ink); }
|
| 40 |
nav.site a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
|
| 41 |
main { padding: 12px 16px 24px; max-width: 1440px; margin: 0 auto; }
|
|
|
|
|
|
|
| 42 |
.controls { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
|
| 43 |
.controls label { display: grid; gap: 2px; font-size: 12px; color: var(--ink-2); min-width: 0; }
|
| 44 |
.controls select { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--axis);
|
|
@@ -124,6 +126,9 @@
|
|
| 124 |
<div class="tablewrap"><table id="table"></table></div>
|
| 125 |
</details>
|
| 126 |
</section>
|
|
|
|
|
|
|
|
|
|
| 127 |
</main>
|
| 128 |
<script>
|
| 129 |
"use strict";
|
|
@@ -562,7 +567,9 @@ async function refresh() {
|
|
| 562 |
|
| 563 |
(async () => {
|
| 564 |
if (EMBED) $("#nav").hidden = true;
|
| 565 |
-
if (FIGURE) {
|
|
|
|
|
|
|
| 566 |
if (params.get("theme")) document.documentElement.dataset.theme = params.get("theme");
|
| 567 |
try {
|
| 568 |
S.tasks = await json("/api/tasks");
|
|
|
|
| 39 |
nav.site a:hover { color: var(--ink); }
|
| 40 |
nav.site a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
|
| 41 |
main { padding: 12px 16px 24px; max-width: 1440px; margin: 0 auto; }
|
| 42 |
+
footer.credit { color: var(--muted); font-size: 12px; margin-top: 14px; }
|
| 43 |
+
footer.credit a { color: var(--ink-2); }
|
| 44 |
.controls { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
|
| 45 |
.controls label { display: grid; gap: 2px; font-size: 12px; color: var(--ink-2); min-width: 0; }
|
| 46 |
.controls select { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--axis);
|
|
|
|
| 126 |
<div class="tablewrap"><table id="table"></table></div>
|
| 127 |
</details>
|
| 128 |
</section>
|
| 129 |
+
<footer class="credit" id="credit">Data: <a href="https://www.rijdendetreinen.nl/en/open-data">Rijden de Treinen</a> open data
|
| 130 |
+
(CC BY 4.0, "Rijden de Treinen"); line layout © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap
|
| 131 |
+
contributors</a> (ODbL 1.0).</footer>
|
| 132 |
</main>
|
| 133 |
<script>
|
| 134 |
"use strict";
|
|
|
|
| 567 |
|
| 568 |
(async () => {
|
| 569 |
if (EMBED) $("#nav").hidden = true;
|
| 570 |
+
if (FIGURE) {
|
| 571 |
+
document.body.classList.add("figure"); $("#controls").hidden = true; $("#tablebox").hidden = true; $("#credit").hidden = true;
|
| 572 |
+
}
|
| 573 |
if (params.get("theme")) document.documentElement.dataset.theme = params.get("theme");
|
| 574 |
try {
|
| 575 |
S.tasks = await json("/api/tasks");
|
openenv/rail_openenv/web/twin/SOURCES.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
| 3 |
`twin.json.gz` is built by `envs/rail_ops/tools/twin/build_twin.py` (`fetch`, then `build`). Frame: metres east and
|
| 4 |
north of 53.22 N, 6.19 E (equirectangular), stored as integer decimetres.
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
| What | Source and licence |
|
| 7 |
|---|---|
|
| 8 |
| track (every rail way near the line: main line, passing loops, yards), platforms, level crossings, station positions | © OpenStreetMap contributors, [ODbL 1.0](https://www.openstreetmap.org/copyright) (Overpass API, data of July-October 2026) |
|
|
|
|
| 3 |
`twin.json.gz` is built by `envs/rail_ops/tools/twin/build_twin.py` (`fetch`, then `build`). Frame: metres east and
|
| 4 |
north of 53.22 N, 6.19 E (equirectangular), stored as integer decimetres.
|
| 5 |
|
| 6 |
+
`twin.json.gz` is an OpenStreetMap-derived database: it is licensed under the
|
| 7 |
+
[ODbL 1.0](https://opendatacommons.org/licenses/odbl/1-0/), © OpenStreetMap contributors, not under the repository's
|
| 8 |
+
MIT licence (which covers this directory's code). The replay shows the credit on screen, in its bottom panel.
|
| 9 |
+
|
| 10 |
| What | Source and licence |
|
| 11 |
|---|---|
|
| 12 |
| track (every rail way near the line: main line, passing loops, yards), platforms, level crossings, station positions | © OpenStreetMap contributors, [ODbL 1.0](https://www.openstreetmap.org/copyright) (Overpass API, data of July-October 2026) |
|
openenv/rail_openenv/web/twin/index.html
CHANGED
|
@@ -66,7 +66,8 @@
|
|
| 66 |
|
| 67 |
<footer id="bottom" class="panel">
|
| 68 |
<div class="graphwrap">
|
| 69 |
-
<div class="chart-h"><b>Train graph</b><span class="muted">time across, distance down · click to jump, hover to read</span>
|
|
|
|
| 70 |
<canvas id="graph"></canvas>
|
| 71 |
<div id="gtip" class="tip" hidden></div>
|
| 72 |
</div>
|
|
|
|
| 66 |
|
| 67 |
<footer id="bottom" class="panel">
|
| 68 |
<div class="graphwrap">
|
| 69 |
+
<div class="chart-h"><b>Train graph</b><span class="muted">time across, distance down · click to jump, hover to read</span>
|
| 70 |
+
<span class="credit">Map © <a href="https://www.openstreetmap.org/copyright" target="_blank" rel="noopener">OpenStreetMap contributors</a> (ODbL) · data <a href="https://www.rijdendetreinen.nl/en/open-data" target="_blank" rel="noopener">Rijden de Treinen</a> (CC BY 4.0)</span></div>
|
| 71 |
<canvas id="graph"></canvas>
|
| 72 |
<div id="gtip" class="tip" hidden></div>
|
| 73 |
</div>
|
openenv/rail_openenv/web/twin/style.css
CHANGED
|
@@ -111,6 +111,11 @@ body.clean #left, body.clean #right { display: none; }
|
|
| 111 |
.graphwrap { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
|
| 112 |
.costwrap { position: relative; flex: 0 0 340px; }
|
| 113 |
.chart-h { display: flex; gap: 10px; align-items: baseline; font-size: 12px; padding-left: 44px; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
#graph { flex: 1; width: 100%; min-height: 0; cursor: crosshair; touch-action: none; }
|
| 115 |
#cost { width: 100%; height: 100%; cursor: crosshair; }
|
| 116 |
.tip { position: absolute; pointer-events: none; background: #f2f1ec; color: #0b0b0b; padding: 4px 8px; border-radius: 6px;
|
|
@@ -165,4 +170,8 @@ body.clean #left, body.clean #right { display: none; }
|
|
| 165 |
#bottom { left: 6px; right: 6px; bottom: 6px; }
|
| 166 |
.costwrap { display: none; }
|
| 167 |
.chart-h .muted { display: none; }
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
}
|
|
|
|
| 111 |
.graphwrap { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
|
| 112 |
.costwrap { position: relative; flex: 0 0 340px; }
|
| 113 |
.chart-h { display: flex; gap: 10px; align-items: baseline; font-size: 12px; padding-left: 44px; }
|
| 114 |
+
/* the map's and the data's credit (ODbL, CC BY): on screen whenever the map is, panels shown or not */
|
| 115 |
+
.chart-h .credit { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden;
|
| 116 |
+
text-overflow: ellipsis; min-width: 0; }
|
| 117 |
+
.chart-h .credit a { color: var(--text-secondary); text-decoration: none; }
|
| 118 |
+
.chart-h .credit a:hover { text-decoration: underline; }
|
| 119 |
#graph { flex: 1; width: 100%; min-height: 0; cursor: crosshair; touch-action: none; }
|
| 120 |
#cost { width: 100%; height: 100%; cursor: crosshair; }
|
| 121 |
.tip { position: absolute; pointer-events: none; background: #f2f1ec; color: #0b0b0b; padding: 4px 8px; border-radius: 6px;
|
|
|
|
| 170 |
#bottom { left: 6px; right: 6px; bottom: 6px; }
|
| 171 |
.costwrap { display: none; }
|
| 172 |
.chart-h .muted { display: none; }
|
| 173 |
+
.chart-h { padding-left: 4px; align-items: flex-start; }
|
| 174 |
+
.chart-h b { white-space: nowrap; }
|
| 175 |
+
/* the credit wraps rather than being cut off: it must stay readable */
|
| 176 |
+
.chart-h .credit { font-size: 10px; line-height: 1.25; white-space: normal; overflow: visible; text-align: right; }
|
| 177 |
}
|