-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDiscreteEnv.py
32 lines (25 loc) · 939 Bytes
/
DiscreteEnv.py
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
"""
Discrete environment class definition.
"""
import numpy as np
from gymnasium import Env, spaces
from gymnasium.utils import seeding
from model_functions import *
"""
Discrete Environment class.
- nS: number of states
- nA: number of actions
- P: transitions as a dictionary of dictionary of lists. P[s][a] = [(probability, nextstate, reward, done), ...]
- mu: initial state distribution as list or array of length nS
- gamma: discount factor
- lastaction: used for rendering
- action_space: action space of the environment
- observation_space: observation space of the environment
Args:
Env (gym.ENV): Environment to be extended to obtain a discrete environment
"""
class DiscreteEnv(Env):
def __init__(self, nS, nA, P, mu, gamma=1., seed=None, render_mode=None) -> None:
pass
def is_terminal(self, state):
pass