Created
July 23, 2022 16:02
-
-
Save WhatIThinkAbout/7ef95729077314cdcebc23c1f897da75 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Dynamic(gym.Space): | |
| def __init__(self, action_list = []): | |
| ' set the list of initially available actions ' | |
| self.set_actions(action_list) | |
| def sample(self): | |
| ' select a random action from the set of available actions ' | |
| return np.random.choice(self.available_actions) | |
| def set_actions(self,actions): | |
| self.available_actions = actions | |
| self.n = len(actions) | |
| def get_available_actions(self): | |
| return [str(action) for action in self.available_actions] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment