Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pure Continuous version of ALE on CPP #550

Merged
merged 33 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9d3605d
step by step
jet-sony Aug 1, 2024
78ad5b4
stash, gotta get back to work
jet-sony Aug 1, 2024
5ae27d9
remove discrete implementation and use only continuous
jjshoots Aug 3, 2024
b2af342
split the thresholds
jjshoots Aug 3, 2024
229f1ed
add thresholds
jjshoots Aug 3, 2024
0355c91
use true-to-game actions
jjshoots Aug 3, 2024
0bc1ea3
I think... I'm happy with this interface for now
jjshoots Aug 3, 2024
998e3e3
amend stella env
jjshoots Aug 3, 2024
c3a9164
remove redundant params
jjshoots Aug 3, 2024
f25a114
make default parameter
jjshoots Aug 3, 2024
10903c5
amend interface to have default parameter at top level
jjshoots Aug 3, 2024
84ca055
swap parameter order and implement continuous for wrappers
jjshoots Aug 3, 2024
9aef3d7
maybe stella shouldn't use default params
jjshoots Aug 3, 2024
3a971e8
move discretization to Python
jjshoots Aug 3, 2024
cef5892
fix some bugs
jjshoots Aug 3, 2024
b9ac273
fix another bug
jjshoots Aug 3, 2024
4189fb8
stash
jjshoots Aug 3, 2024
9dfe314
stash
jjshoots Aug 3, 2024
3c9c8aa
fix some more bugs
jjshoots Aug 3, 2024
86722e9
ALWAYS the rogue curlies you gotta watch out for
jjshoots Aug 3, 2024
fae19c1
streamline
jjshoots Aug 3, 2024
2e3d879
fixing tests
jjshoots Aug 3, 2024
d7f37b7
make int
jjshoots Aug 3, 2024
ea133ae
fix argument
jjshoots Aug 3, 2024
444dde3
passing tests
jjshoots Aug 3, 2024
2d86927
fix bug
jjshoots Aug 3, 2024
b58e9b2
use full action space in continuous mode
jjshoots Aug 3, 2024
a5df888
precommit
jjshoots Aug 3, 2024
ea2303f
fix bug
jjshoots Aug 3, 2024
394c515
additional warning
jjshoots Aug 3, 2024
be3e869
precommit
jjshoots Aug 3, 2024
c38033e
update interface signature
jjshoots Aug 4, 2024
140f95e
change to default emulate strength 1.0
jjshoots Aug 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ authors = [
{name = "Michael Bowling"},
]
maintainers = [
{ name = "Farama Foundation", email = "[email protected]" },
{name = "Farama Foundation", email = "[email protected]"},
{name = "Jesse Farebrother", email = "[email protected]"},
]
classifiers = [
Expand Down
13 changes: 3 additions & 10 deletions src/ale_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,9 @@ int ALEInterface::lives() {
// user's responsibility to check if the game has ended and reset
// when necessary - this method will keep pressing buttons on the
// game over screen.
reward_t ALEInterface::act(Action action) {
return environment->act(action, PLAYER_B_NOOP);
}

// Applies a continuous action to the game and returns the reward. It is the
// user's responsibility to check if the game has ended and reset
// when necessary - this method will keep pressing buttons on the
// game over screen.
reward_t ALEInterface::actContinuous(float r, float theta, float fire) {
return environment->actContinuous(r, theta, fire, 0.0, 0.0, 0.0);
// Intentionally set player B actions to 0 since we are in single player mode
reward_t ALEInterface::act(Action action, float paddle_strength) {
return environment->act(action, PLAYER_B_NOOP, paddle_strength, 0.0);
}

// Returns the vector of modes available for the current game.
Expand Down
8 changes: 1 addition & 7 deletions src/ale_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,7 @@ class ALEInterface {
// user's responsibility to check if the game has ended and reset
// when necessary - this method will keep pressing buttons on the
// game over screen.
reward_t act(Action action);

// Applies a continuous action to the game and returns the reward. It is the
// user's responsibility to check if the game has ended and reset
// when necessary - this method will keep pressing buttons on the
// game over screen.
reward_t actContinuous(float r, float theta, float fire);
reward_t act(Action action, float paddle_strength = 1.0);

// Indicates if the game has ended.
bool game_over(bool with_truncation = true) const;
Expand Down
1 change: 0 additions & 1 deletion src/emucore/Settings.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ void Settings::setDefaultSettings() {
boolSettings.insert(std::pair<std::string, bool>("send_rgb", false));
intSettings.insert(std::pair<std::string, int>("frame_skip", 1));
floatSettings.insert(std::pair<std::string, float>("repeat_action_probability", 0.25));
floatSettings.insert(std::pair<std::string, float>("continuous_action_threshold", 0.5));
stringSettings.insert(std::pair<std::string, std::string>("rom_file", ""));
// Whether to truncate an episode on loss of life.
boolSettings.insert(std::pair<std::string, bool>("truncate_on_loss_of_life", false));
Expand Down
Loading
Loading