Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -14,6 +14,15 @@ base_path: /web
|
|
| 14 |
|
| 15 |
CityFlow-based traffic-control project with intersection-level multi-agent DQN training and district-aware policy variants.
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
## Training
|
| 18 |
|
| 19 |
The default local-policy trainer now uses parameter-shared dueling Double DQN with prioritized replay and n-step returns:
|
|
|
|
| 14 |
|
| 15 |
CityFlow-based traffic-control project with intersection-level multi-agent DQN training and district-aware policy variants.
|
| 16 |
|
| 17 |
+
## OpenEnv UI
|
| 18 |
+
|
| 19 |
+
For the deployed OpenEnv web interface:
|
| 20 |
+
|
| 21 |
+
- Click `Reset` before using `Step`.
|
| 22 |
+
- Leave `Use Llm` unchecked for the fast, stable DQN-only path.
|
| 23 |
+
- Use `District Actions` = `{}` for a valid no-op step payload.
|
| 24 |
+
- Only enable `Use Llm` when you explicitly want district-level LLM guidance on top of the DQN executor.
|
| 25 |
+
|
| 26 |
## Training
|
| 27 |
|
| 28 |
The default local-policy trainer now uses parameter-shared dueling Double DQN with prioritized replay and n-step returns:
|
models.py
CHANGED
|
@@ -4,10 +4,17 @@ import json
|
|
| 4 |
from typing import Any
|
| 5 |
|
| 6 |
from openenv.core.env_server import Action, Observation, State
|
| 7 |
-
from pydantic import Field, field_validator
|
| 8 |
|
| 9 |
|
| 10 |
class AgenticTrafficAction(Action):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
use_llm: bool = Field(
|
| 12 |
default=False,
|
| 13 |
description=(
|
|
@@ -16,11 +23,16 @@ class AgenticTrafficAction(Action):
|
|
| 16 |
),
|
| 17 |
)
|
| 18 |
district_actions: dict[str, Any] = Field(
|
| 19 |
-
|
| 20 |
description=(
|
| 21 |
"JSON object keyed by district_id. Use {} for a no-op step, or provide "
|
| 22 |
'entries like {"d_00":{"strategy":"hold","phase_bias":"NS","duration_steps":10}}.'
|
| 23 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
)
|
| 25 |
llm_max_new_tokens: int = Field(
|
| 26 |
default=128,
|
|
|
|
| 4 |
from typing import Any
|
| 5 |
|
| 6 |
from openenv.core.env_server import Action, Observation, State
|
| 7 |
+
from pydantic import ConfigDict, Field, field_validator
|
| 8 |
|
| 9 |
|
| 10 |
class AgenticTrafficAction(Action):
|
| 11 |
+
model_config = ConfigDict(
|
| 12 |
+
extra="forbid",
|
| 13 |
+
validate_assignment=True,
|
| 14 |
+
arbitrary_types_allowed=True,
|
| 15 |
+
validate_default=True,
|
| 16 |
+
)
|
| 17 |
+
|
| 18 |
use_llm: bool = Field(
|
| 19 |
default=False,
|
| 20 |
description=(
|
|
|
|
| 23 |
),
|
| 24 |
)
|
| 25 |
district_actions: dict[str, Any] = Field(
|
| 26 |
+
default="{}",
|
| 27 |
description=(
|
| 28 |
"JSON object keyed by district_id. Use {} for a no-op step, or provide "
|
| 29 |
'entries like {"d_00":{"strategy":"hold","phase_bias":"NS","duration_steps":10}}.'
|
| 30 |
),
|
| 31 |
+
json_schema_extra={
|
| 32 |
+
"type": "string",
|
| 33 |
+
"maxLength": 4000,
|
| 34 |
+
"default": "{}",
|
| 35 |
+
},
|
| 36 |
)
|
| 37 |
llm_max_new_tokens: int = Field(
|
| 38 |
default=128,
|