MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.gym.AtariGym Class Reference

The Atari Gym provides acess to the Atari-2600 Emulator from Stella (https://github.com/stella-emu/stella) via a slightly modified version of the Arcade-Learning-Envrionment (ALE) from mgbellemare (https://github.com/mgbellemare/Arcade-Learning-Environment). More...

Inheritance diagram for MyCaffe.gym.AtariGym:
MyCaffe.gym.IXMyCaffeGym

Public Member Functions

 AtariGym ()
 The constructor. More...
 
void Dispose ()
 Release all resources used. More...
 
void Initialize (Log log, PropertySet properties)
 Initialize the gym with the specified properties. More...
 
IXMyCaffeGym Clone (PropertySet properties=null)
 Create a new copy of the gym. More...
 
Dictionary< string, int > GetActionSpace ()
 Returns the action space as a dictionary of name,actionid pairs. More...
 
void Close ()
 Shutdown and close the gym. More...
 
Tuple< Bitmap, SimpleDatumRender (bool bShowUi, int nWidth, int nHeight, bool bGetAction)
 Render the gym's current state on a bitmap and SimpleDatum. More...
 
Tuple< Bitmap, SimpleDatumRender (bool bShowUi, int nWidth, int nHeight, double[] rgData, bool bGetAction)
 Render the gyms specified data. More...
 
Tuple< State, double, bool > Reset (bool bGetLabel, PropertySet props=null)
 Reset the state of the gym. More...
 
Tuple< State, double, bool > Step (int nAction, bool bGetLabel, PropertySet propExtra=null)
 Step the gym one step in its simulation. More...
 
DatasetDescriptor GetDataset (DATA_TYPE dt, Log log=null)
 Returns the dataset descriptor of the dynamic dataset produced by the Gym. More...
 

Properties

bool RequiresDisplayImage [get]
 Returns true indicating that this Gym requires a display image. More...
 
DATA_TYPE SelectedDataType [get]
 Returns the selected data type. More...
 
DATA_TYPE[] SupportedDataType [get]
 Returns the data types supported by this gym. More...
 
string Name [get]
 Returns the gym's name. More...
 
int UiDelay [get]
 Returns the delay to use (if any) when the user-display is visible. More...
 
double TestingPercent [get]
 Returns the testinng percent of -1, which then uses the default of 0.2. More...
 
- Properties inherited from MyCaffe.gym.IXMyCaffeGym
string Name [get]
 Returns the name of the gym. More...
 
int UiDelay [get]
 Returns the user-interface delay to use (if any). More...
 
DATA_TYPE SelectedDataType [get]
 Returns the selected data-type. More...
 
DATA_TYPE[] SupportedDataType [get]
 Returns an array of data types supported by the gym. More...
 
bool RequiresDisplayImage [get]
 Returns whether or not the gym requires the display image. More...
 
double TestingPercent [get]
 Returns the percentage of the data to use for testing, or -1 which then uses the default of 0.2. More...
 

Detailed Description

The Atari Gym provides acess to the Atari-2600 Emulator from Stella (https://github.com/stella-emu/stella) via a slightly modified version of the Arcade-Learning-Envrionment (ALE) from mgbellemare (https://github.com/mgbellemare/Arcade-Learning-Environment).

This gym is a rewrite of the original atari gym provided by OpenAi under the MIT license and located on GitHub at: https://github.com/openai/gym/blob/master/gym/envs/atari/atari_env.py License: https://github.com/openai/gym/blob/master/LICENSE.md

The original Atari-2600 Emulator from Stella (https://github.com/stella-emu/stella) is distributed under the GPL license (https://github.com/stella-emu/stella/blob/master/License.txt)

The original Arcade-Learning-Envrionment (ALE) from mgbellemare (https://github.com/mgbellemare/Arcade-Learning-Environment) also distributed under the GPL license (https://github.com/mgbellemare/Arcade-Learning-Environment/blob/master/License.txt).

The Arcade-Learning-Environment (ALE) uses the Simple DrectMedia Layer (SDL) which is a cross-platform library designed to make it easy to write multi-media software, such as games and emulators. The SDL source code is available from: http://www.libsdl.org/ and the library is distrubted under the terms of the GNU LGPL license: http://www.gnu.org/copyleft/lesser.html

Definition at line 41 of file AtariGym.cs.

Constructor & Destructor Documentation

◆ AtariGym()

MyCaffe.gym.AtariGym.AtariGym ( )

The constructor.

Definition at line 64 of file AtariGym.cs.

Member Function Documentation

◆ Clone()

IXMyCaffeGym MyCaffe.gym.AtariGym.Clone ( PropertySet  properties = null)

Create a new copy of the gym.

Parameters
propertiesOptionally, specifies the properties to initialize the new copy with.
Returns
The new Gym copy is returned.

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 176 of file AtariGym.cs.

◆ Close()

void MyCaffe.gym.AtariGym.Close ( )

Shutdown and close the gym.

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 246 of file AtariGym.cs.

◆ Dispose()

void MyCaffe.gym.AtariGym.Dispose ( )

Release all resources used.

Definition at line 71 of file AtariGym.cs.

◆ GetActionSpace()

Dictionary< string, int > MyCaffe.gym.AtariGym.GetActionSpace ( )

Returns the action space as a dictionary of name,actionid pairs.

Returns
The action space is returned.

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 238 of file AtariGym.cs.

◆ GetDataset()

DatasetDescriptor MyCaffe.gym.AtariGym.GetDataset ( DATA_TYPE  dt,
Log  log = null 
)

Returns the dataset descriptor of the dynamic dataset produced by the Gym.

Parameters
dtSpecifies the data-type to use.
logOptionally, specifies the output log to use (default = null).
Returns
The dataset descriptor is returned.

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 463 of file AtariGym.cs.

◆ Initialize()

void MyCaffe.gym.AtariGym.Initialize ( Log  log,
PropertySet  properties 
)

Initialize the gym with the specified properties.

Parameters
logSpecifies the output log to use.
propertiesSpecifies the properties containing Gym specific initialization parameters.

The AtariGym uses the following initialization properties. GameRom='path to .rom file'

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 101 of file AtariGym.cs.

◆ Render() [1/2]

Tuple< Bitmap, SimpleDatum > MyCaffe.gym.AtariGym.Render ( bool  bShowUi,
int  nWidth,
int  nHeight,
bool  bGetAction 
)

Render the gym's current state on a bitmap and SimpleDatum.

Parameters
bShowUiWhen true the Bitmap is drawn.
nWidthSpecifies the width used to size the Bitmap.
nHeightSpecifies the height used to size the Bitmap.
bGetActionWhen true the action data is returned as a SimpleDatum.
Returns
A tuple optionally containing a Bitmap and/or Simpledatum is returned.

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 263 of file AtariGym.cs.

◆ Render() [2/2]

Tuple< Bitmap, SimpleDatum > MyCaffe.gym.AtariGym.Render ( bool  bShowUi,
int  nWidth,
int  nHeight,
double[]  rgData,
bool  bGetAction 
)

Render the gyms specified data.

Parameters
bShowUiWhen true the Bitmap is drawn.
nWidthSpecifies the width used to size the Bitmap.
nHeightSpecifies the height used to size the Bitmap.
rgDataSpecifies the gym data to render.
bGetActionWhen true the action data is returned as a SimpleDatum.
Returns
A tuple optionally containing a Bitmap and/or Simpledatum is returned.

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 278 of file AtariGym.cs.

◆ Reset()

Tuple< State, double, bool > MyCaffe.gym.AtariGym.Reset ( bool  bGetLabel,
PropertySet  props = null 
)

Reset the state of the gym.

Parameters
bGetLabelNot used.
propsOptionally, specifies extra properties.
Returns
A tuple containing state data, the reward, and the done state is returned.

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 420 of file AtariGym.cs.

◆ Step()

Tuple< State, double, bool > MyCaffe.gym.AtariGym.Step ( int  nAction,
bool  bGetLabel,
PropertySet  propExtra = null 
)

Step the gym one step in its simulation.

Parameters
nActionSpecifies the action to run on the gym.
bGetLabelNot used.
propExtraOptionally, specifies extra parameters.
Returns
A tuple containing state data, the reward, and the done state is returned.

Implements MyCaffe.gym.IXMyCaffeGym.

Definition at line 434 of file AtariGym.cs.

Property Documentation

◆ Name

string MyCaffe.gym.AtariGym.Name
get

Returns the gym's name.

Definition at line 213 of file AtariGym.cs.

◆ RequiresDisplayImage

bool MyCaffe.gym.AtariGym.RequiresDisplayImage
get

Returns true indicating that this Gym requires a display image.

Definition at line 189 of file AtariGym.cs.

◆ SelectedDataType

DATA_TYPE MyCaffe.gym.AtariGym.SelectedDataType
get

Returns the selected data type.

Definition at line 197 of file AtariGym.cs.

◆ SupportedDataType

DATA_TYPE [] MyCaffe.gym.AtariGym.SupportedDataType
get

Returns the data types supported by this gym.

Definition at line 205 of file AtariGym.cs.

◆ TestingPercent

double MyCaffe.gym.AtariGym.TestingPercent
get

Returns the testinng percent of -1, which then uses the default of 0.2.

Definition at line 229 of file AtariGym.cs.

◆ UiDelay

int MyCaffe.gym.AtariGym.UiDelay
get

Returns the delay to use (if any) when the user-display is visible.

Definition at line 221 of file AtariGym.cs.


The documentation for this class was generated from the following file: