Spaces:
Sleeping
Sleeping
Commit ·
f59c3d3
1
Parent(s): 867d483
Expose README content via environment metadata
Browse files
server/Container_Yard_environment.py
CHANGED
|
@@ -15,9 +15,10 @@ minimize rehandles during retrieval operations.
|
|
| 15 |
from uuid import uuid4
|
| 16 |
from typing import List, Tuple
|
| 17 |
import random
|
|
|
|
| 18 |
|
| 19 |
from openenv.core.env_server.interfaces import Environment
|
| 20 |
-
from openenv.core.env_server.types import State
|
| 21 |
|
| 22 |
try:
|
| 23 |
from ..models import ContainerYardAction, ContainerYardObservation, Container
|
|
@@ -72,6 +73,24 @@ class ContainerYardEnvironment(Environment):
|
|
| 72 |
self.max_stack_height = config["max_height"]
|
| 73 |
self.priorities = config["priorities"]
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
def reset(self) -> ContainerYardObservation:
|
| 76 |
"""
|
| 77 |
Reset the environment for a new episode.
|
|
|
|
| 15 |
from uuid import uuid4
|
| 16 |
from typing import List, Tuple
|
| 17 |
import random
|
| 18 |
+
from pathlib import Path
|
| 19 |
|
| 20 |
from openenv.core.env_server.interfaces import Environment
|
| 21 |
+
from openenv.core.env_server.types import EnvironmentMetadata, State
|
| 22 |
|
| 23 |
try:
|
| 24 |
from ..models import ContainerYardAction, ContainerYardObservation, Container
|
|
|
|
| 73 |
self.max_stack_height = config["max_height"]
|
| 74 |
self.priorities = config["priorities"]
|
| 75 |
|
| 76 |
+
def get_metadata(self) -> EnvironmentMetadata:
|
| 77 |
+
"""Return environment metadata, including README content for the web UI."""
|
| 78 |
+
readme_content = None
|
| 79 |
+
readme_path = Path(__file__).resolve().parents[1] / "README.md"
|
| 80 |
+
if readme_path.exists():
|
| 81 |
+
readme_content = readme_path.read_text(encoding="utf-8")
|
| 82 |
+
|
| 83 |
+
return EnvironmentMetadata(
|
| 84 |
+
name="Container Yard",
|
| 85 |
+
description=(
|
| 86 |
+
"Port container yard simulation where agents place arriving containers "
|
| 87 |
+
"to minimize retrieval rehandles."
|
| 88 |
+
),
|
| 89 |
+
readme_content=readme_content,
|
| 90 |
+
version="0.1.0",
|
| 91 |
+
author="Draken1606",
|
| 92 |
+
)
|
| 93 |
+
|
| 94 |
def reset(self) -> ContainerYardObservation:
|
| 95 |
"""
|
| 96 |
Reset the environment for a new episode.
|