File size: 812 Bytes
fdd14ba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34b2bf3
fdd14ba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
be46a16
fdd14ba
 
 
 
 
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
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

"""
Data models for Maze Environment.

This module defines the Action, Observation, and State types for Maze games.
"""

from __future__ import annotations

from dataclasses import dataclass, field
from typing import List

from core.env_server import Action, Observation, State


@dataclass
class MazeAction(Action):
    action: int


@dataclass
class MazeObservation(Observation):
    position: List[int]  # [row, col]
    total_reward: float
    legal_actions: List[int] = field(default_factory=list)


@dataclass
class MazeState(State):
    episode_id: str
    step_count: int
    done: bool = False