Class: ALEInterface
- Inherits:
-
Object
- Object
- ALEInterface
- Defined in:
- lib/ale_ruby_interface.rb
Instance Method Summary collapse
- #act(action) ⇒ Object
- #clone_state ⇒ Object
- #clone_system_state ⇒ Object
- #decode_state ⇒ Object
- #delete_state ⇒ Object
- #encode_state ⇒ Object
- #encode_state_len ⇒ Object
- #game_over ⇒ Object
- #get_available_difficuties ⇒ Object
- #get_available_modes ⇒ Object
- #get_bool(key) ⇒ Object
- #get_episode_frame_number ⇒ Object
- #get_float(key) ⇒ Object
- #get_frame_number ⇒ Object
- #get_int(key) ⇒ Object
- #get_legal_action_set ⇒ Object
- #get_minimal_action_set ⇒ Object
- #get_RAM ⇒ Object
- #get_RAM_size ⇒ Object
- #get_screen ⇒ Object
- #get_screen_dims ⇒ Object
- #get_screen_grayscale ⇒ Object
- #get_screen_RGB ⇒ Object
- #get_string(key) ⇒ Object
-
#initialize ⇒ ALEInterface
constructor
include ALELib.
- #lives ⇒ Object
- #load_rom(rom_file) ⇒ Object
- #load_state ⇒ Object
- #reset_game ⇒ Object
- #restore_state ⇒ Object
- #restore_system_state ⇒ Object
- #save_screen_PNG ⇒ Object
- #save_state ⇒ Object
- #set_bool(key, value) ⇒ Object
- #set_difficulty ⇒ Object
- #set_float(key, value) ⇒ Object
- #set_int(key, value) ⇒ Object
- #set_mode ⇒ Object
- #set_string(key, value) ⇒ Object
Constructor Details
#initialize ⇒ ALEInterface
include ALELib
58 59 60 |
# File 'lib/ale_ruby_interface.rb', line 58 def initialize @obj = ALELib.ALE_new end |
Instance Method Details
#act(action) ⇒ Object
98 99 100 |
# File 'lib/ale_ruby_interface.rb', line 98 def act(action) return ALELib.act(@obj, action.to_i) end |
#clone_state ⇒ Object
174 175 |
# File 'lib/ale_ruby_interface.rb', line 174 def clone_state end |
#clone_system_state ⇒ Object
180 181 |
# File 'lib/ale_ruby_interface.rb', line 180 def clone_system_state end |
#decode_state ⇒ Object
195 196 |
# File 'lib/ale_ruby_interface.rb', line 195 def decode_state end |
#delete_state ⇒ Object
186 187 |
# File 'lib/ale_ruby_interface.rb', line 186 def delete_state end |
#encode_state ⇒ Object
192 193 |
# File 'lib/ale_ruby_interface.rb', line 192 def encode_state end |
#encode_state_len ⇒ Object
189 190 |
# File 'lib/ale_ruby_interface.rb', line 189 def encode_state_len end |
#game_over ⇒ Object
102 103 104 |
# File 'lib/ale_ruby_interface.rb', line 102 def game_over return ALELib.game_over(@obj) end |
#get_available_difficuties ⇒ Object
126 127 |
# File 'lib/ale_ruby_interface.rb', line 126 def get_available_difficuties end |
#get_available_modes ⇒ Object
120 121 |
# File 'lib/ale_ruby_interface.rb', line 120 def get_available_modes end |
#get_bool(key) ⇒ Object
70 71 72 |
# File 'lib/ale_ruby_interface.rb', line 70 def get_bool(key) return ALELib.getBool(@obj, key) end |
#get_episode_frame_number ⇒ Object
144 145 |
# File 'lib/ale_ruby_interface.rb', line 144 def get_episode_frame_number end |
#get_float(key) ⇒ Object
74 75 76 |
# File 'lib/ale_ruby_interface.rb', line 74 def get_float(key) return ALELib.getFloat(@obj, key) end |
#get_frame_number ⇒ Object
138 139 |
# File 'lib/ale_ruby_interface.rb', line 138 def get_frame_number end |
#get_int(key) ⇒ Object
66 67 68 |
# File 'lib/ale_ruby_interface.rb', line 66 def get_int(key) return ALELib.getInt(@obj, key) end |
#get_legal_action_set ⇒ Object
110 111 112 113 114 115 |
# File 'lib/ale_ruby_interface.rb', line 110 def get_legal_action_set act_size = ALELib.getLegalActionSize(@obj) act = NMatrix.zeros[act_size] ALELib.getLegalActionSet(@obj, act) return act end |
#get_minimal_action_set ⇒ Object
117 118 |
# File 'lib/ale_ruby_interface.rb', line 117 def get_minimal_action_set end |
#get_RAM ⇒ Object
162 163 |
# File 'lib/ale_ruby_interface.rb', line 162 def get_RAM end |
#get_RAM_size ⇒ Object
159 160 |
# File 'lib/ale_ruby_interface.rb', line 159 def get_RAM_size end |
#get_screen ⇒ Object
150 151 |
# File 'lib/ale_ruby_interface.rb', line 150 def get_screen end |
#get_screen_dims ⇒ Object
147 148 |
# File 'lib/ale_ruby_interface.rb', line 147 def get_screen_dims end |
#get_screen_grayscale ⇒ Object
156 157 |
# File 'lib/ale_ruby_interface.rb', line 156 def get_screen_grayscale end |
#get_screen_RGB ⇒ Object
153 154 |
# File 'lib/ale_ruby_interface.rb', line 153 def get_screen_RGB end |
#get_string(key) ⇒ Object
62 63 64 |
# File 'lib/ale_ruby_interface.rb', line 62 def get_string(key) return ALELib.getString(@obj, key) end |
#lives ⇒ Object
141 142 |
# File 'lib/ale_ruby_interface.rb', line 141 def lives end |
#load_rom(rom_file) ⇒ Object
94 95 96 |
# File 'lib/ale_ruby_interface.rb', line 94 def load_rom(rom_file) ALELib.loadROM(@obj, rom_file) end |
#load_state ⇒ Object
171 172 |
# File 'lib/ale_ruby_interface.rb', line 171 def load_state end |
#reset_game ⇒ Object
106 107 108 |
# File 'lib/ale_ruby_interface.rb', line 106 def reset_game ALELib.game_over(@obj) end |
#restore_state ⇒ Object
177 178 |
# File 'lib/ale_ruby_interface.rb', line 177 def restore_state end |
#restore_system_state ⇒ Object
183 184 |
# File 'lib/ale_ruby_interface.rb', line 183 def restore_system_state end |
#save_screen_PNG ⇒ Object
165 166 |
# File 'lib/ale_ruby_interface.rb', line 165 def save_screen_PNG end |
#save_state ⇒ Object
168 169 |
# File 'lib/ale_ruby_interface.rb', line 168 def save_state end |
#set_bool(key, value) ⇒ Object
86 87 88 |
# File 'lib/ale_ruby_interface.rb', line 86 def set_bool(key, value) ALELib.setBool(@obj, key, value) end |
#set_difficulty ⇒ Object
129 130 |
# File 'lib/ale_ruby_interface.rb', line 129 def set_difficulty end |
#set_float(key, value) ⇒ Object
90 91 92 |
# File 'lib/ale_ruby_interface.rb', line 90 def set_float(key, value) ALELib.setFloat(@obj, key, value) end |
#set_int(key, value) ⇒ Object
82 83 84 |
# File 'lib/ale_ruby_interface.rb', line 82 def set_int(key, value) ALELib.setInt(@obj, key, value) end |
#set_mode ⇒ Object
123 124 |
# File 'lib/ale_ruby_interface.rb', line 123 def set_mode end |
#set_string(key, value) ⇒ Object
78 79 80 |
# File 'lib/ale_ruby_interface.rb', line 78 def set_string(key, value) ALELib.setString(@obj, key, value) end |