Skip to content

Commit

Permalink
fixed some bugs
Browse files Browse the repository at this point in the history
mablue committed Jun 2, 2021

Verified

This commit was signed with the committer’s verified signature.
Matthew-Whitlock Matthew Whitlock
1 parent 0cff8b5 commit 594439f
Showing 2 changed files with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
from gym import spaces
from gym.utils import seeding
from gym.envs.classic_control import rendering
MONKEY_HIGH = 10000
MONKEY_HIGH = 50
NUMBER_OF_ROPES = 30


@@ -49,8 +49,7 @@ def step(self, action):

if self.monkey_last_pos != self.monkey_pos:
self.monkey_last_high = self.monkey_high
self.monkey_high = self.monkey_high / \
self.ropes.iat[-1, self.monkey_pos]
self.monkey_high = self.ropes.iat[-1, self.monkey_pos]
# self.rope_high = self.ropes.iat[-1, self.monkey_pos]
# self.last_rope_high = self.ropes.iat[-1, self.monkey_last_pos]
# self.monkey_last_high = self.monkey_high * self.last_rope_high
@@ -116,7 +115,7 @@ def close(self):
df.insert(loc=0, column=0, value=[1]*100)


# for example we have 1USDT in start(MONKEY_HIGH=1)
# for example we have 50$ in start
env = monkeyEnv(ropes=df, monkey_high=MONKEY_HIGH, n=30)

model = PPO("MlpPolicy", env, verbose=1)
@@ -132,6 +131,6 @@ def close(self):
action, _states = model.predict(obs)
obs, rewards, dones, info = env.step(action)
env.render()
print(info['monkey_high'], 1)
print(info['monkey_high'])
if info['time'] >= 100:
env.reset()
Binary file modified ppo_monkey.zip
Binary file not shown.

0 comments on commit 594439f

Please sign in to comment.