How to check Done/Termination condition in the Scalarised version of Coinrun
Unimax opened this issue · 1 comments
Unimax commented
Basically i need standard Scalar version of the Coinrun env (like a gym env) so i can apply various q-learning algos. (i will be using pytorch not that it matters)
From one of the resolved issue i get my hands on the Scalarise class but the level is not changing for some reason it's saying "CoinRun ignores resets" on the console probably becuase of "env.reset()"
example script (i placed it in train_agent.py):-
def testing():
episodes = 10
env = Scalarize(make('standard', num_envs=1))
for i in range(episodes):
start_state = env.reset()
while True:
env.render()
action = np.random.randint(0, env.action_space.n)
next_state, reward, done, info = env.step(action)
if done or reward > 0:
break
Unimax commented
am sorry after writing this i figured out that i hardcoded the number of levels somewhere in my code.
closing the issue.