Commit 4bc860a4 authored by Shivam Khandelwal's avatar Shivam Khandelwal
Browse files

Made number of evaluations available in train.py code

To avoid redundant code initialisation by calling main() multiple times, the control to start consecutive evaluation episode is transferred to participants
parent aac2ebdf
......@@ -13,6 +13,7 @@ coloredlogs.install(logging.DEBUG)
# All the evaluations will be evaluated on MineRLObtainDiamond-v0 environment
MINERL_GYM_ENV = os.getenv('MINERL_GYM_ENV', 'MineRLObtainDiamond-v0')
MINERL_MAX_EVALUATION_EPISODES = int(os.getenv('MINERL_MAX_EVALUATION_EPISODES', 5))
def main():
"""
......@@ -24,7 +25,7 @@ def main():
actions = [env.action_space.sample() for _ in range(10)]
xposes = []
for _ in range(1):
for _ in range(MINERL_MAX_EVALUATION_EPISODES):
obs = env.reset()
done = False
netr = 0
......@@ -37,7 +38,6 @@ def main():
random_act['attack'] = 1
obs, reward, done, info = env.step(random_act)
netr += reward
env.render()
env.close()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment