Cope 2.5.0
My personal "standard library" of all the generally useful code I've written for various projects over the years
|
def Cope.gym.SimpleGym.__init__ | ( | self, | |
max_steps = None , |
|||
screen_size = 300 , |
|||
fps = None , |
|||
name = 'SimpleGym Enviorment' , |
|||
show_vars = {} , |
|||
show_strings = [] , |
|||
start_paused = False , |
|||
render_mode = 'pygame' , |
|||
assert_valid_action = True , |
|||
background_color = (20, 20, 20) , |
|||
print_color = (200, 20, 20, 0) , |
|||
show_events = False , |
|||
verbose = True |
|||
) |
This should be called first, if you want to use the members like self.size Parameters: max_steps
: if positive, sets the maximum number of steps before the env resets itself.
If None or negative, no limit screen_size
: the size of the pygame window. Can be a 2 item tuple of (width, height) or a single int if the window is to be square fps
: controls how fast the simulation runs. Set to negative or None to have no limit name
: the name of the enviorment shown on the window title show_vars
: a dictionary of {name: member} of members you want to have printed on the screen. The keys can be any string, and the values must be valid members of this class show_strings
: a list of strings you want to have printed on the screen start_paused
: self-explanitory show_events
: prints events, other than mouse movements, for debugging purpouses render_mode
: part of the gymnasium specification. Must be either None or 'pygame', unless you manually override the render() method assert_valid_action
: ensures that actions given to step() are within the action_space background_color
: a 3 item tuple specifying the background color print_color
: a 4 item tuple (the 4th index being alpha) specifying the color of the extra data printed to the screen verbose
: when set to True, it simply adds fps
, reset_count
, steps
, total_steps
to show_vars
. Also shows the help menu for the first few seconds