Skip to content

Commit

Permalink
Changed reward scheme for Pyraminx LBL Method and Skewb Sarah's Method
Browse files Browse the repository at this point in the history
  • Loading branch information
DoubleGremlin181 committed Jul 13, 2020
1 parent 8975f0d commit d95fd04
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions rubiks_cube_gym/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
)

register(
id='pyraminx-wo-tips-lbl-v0',
id='pyraminx-wo-tips-lbl-v1',
entry_point='rubiks_cube_gym.envs:PyraminxWoTipsEnvLBL',
max_episode_steps=250,
)
Expand All @@ -37,7 +37,7 @@
)

register(
id='skewb-sarah-v0',
id='skewb-sarah-v1',
entry_point='rubiks_cube_gym.envs:SkewbEnvSarah',
max_episode_steps=250,
)
7 changes: 3 additions & 4 deletions rubiks_cube_gym/envs/pyraminx_wo_tips_lbl.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class PyraminxWoTipsEnvLBL(PyraminxWoTipsEnv):
def __init__(self):
super(PyraminxWoTipsEnvLBL, self).__init__()
self.FL = None
self.OLL = None

def check_FL(self):
for pos in FL_POS:
Expand All @@ -20,17 +19,17 @@ def check_solved(self):
return True

def reward(self):
reward = -40 * self.FL
reward = -25 * self.FL
done = False

if self.check_FL():
reward += 40
reward += 25
self.FL = True
else:
self.FL = False

if self.check_solved():
reward += 60
reward += 75
done = True

if reward <= 0:
Expand Down
6 changes: 3 additions & 3 deletions rubiks_cube_gym/envs/skewb_sarah.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ def check_solved(self):
return True

def reward(self):
reward = -40 * self.FL
reward = -25 * self.FL
done = False

if self.check_FL():
reward += 40
reward += 25
self.FL = True
else:
self.FL = False

if self.check_solved():
reward += 60
reward += 75
done = True

if reward <= 0:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
long_description = f.read()

setup(name='rubiks_cube_gym',
version='0.3.1',
version='0.4.0',
url="https://github.com/DoubleGremlin181/RubiksCubeGym/",
description="OpenAI Gym environments for various twisty puzzles",
long_description=long_description,
Expand Down

0 comments on commit d95fd04

Please sign in to comment.