play ( env : Env, transpose : Optional = True, fps : Optional = None, zoom : Optional = None, callback : Optional = None, keys_to_action : Optional ], str ], ActType ] ] = None, seed : Optional = None, noop : ActType = 0 ) #Īllows one to play the game using keyboard. Transpose – If to transpose the array on the screen Video_size – The video size of the screen display_arr ( screen : Surface, arr : ndarray, video_size : Tuple, transpose : bool ) #ĭisplays a numpy array on screen. Info – The information from the environment Truncated – If the environment is truncated Terminated – If the environment is terminated Obs_tp1 – The observation at time step t+1 The callback that calls the provided data callback and adds the data to the plots. Horizon_timesteps – The time horizon used for the live plotsĭependencyNotInstalled – If matplotlib is not installed callback ( obs_t : ObsType, obs_tp1 : ObsType, action : ActType, rew : float, terminated : bool, truncated : bool, info : dict ) # Parameters :Ĭallback – Function that computes metrics from environment transitions The function callback that is passed to this constructor should returnĪ list of metrics that is of length len(plot_names). callback ) _init_ ( callback : callable, horizon_timesteps : int, plot_names : List ) # plot_names = ) > play ( your_env, callback = plotter. > plotter = PlayPlot ( compute_metrics, horizon_timesteps = 200. It should return a list of metrics that are computed from this data.įor instance, the function may look like this: Truncated: whether the environment is truncated or not Terminated: whether the environment is terminated or not Obs_tp1: observation after performing action Obs_t: observation before performing action This class is instantiated with a function that accepts information about a single environment transition: Provides a callback to create live plots of arbitrary metrics when using play(). PlayPlot ( callback : callable, horizon_timesteps : int, plot_names : List ) # Parameters :Įvent – The event to process class. In particular, this function is used to keep track of which buttons are currently pressedĪnd to exit the play() function when the PyGame window is closed. Zoom – If to zoom in on the environment render Keys_to_action – The dictionary of keyboard tuples and action value Wraps an environment with a dictionary of keyboard buttons to action and if to zoom in on the environment. _init_ ( env : Env, keys_to_action : Optional, int ] ] = None, zoom : Optional = None ) # Wraps an environment allowing keyboard inputs to interact with the environment. PlayableGame ( env : Env, keys_to_action : Optional, int ] ] = None, zoom : Optional = None ) # Toggle table of contents sidebar Utils # Visualization # class.
0 Comments
Leave a Reply. |