Tianshou/test/pettingzoo/test_pistonball.py
Mohammad Mahdi Rahimi c7e2e56fac
Pettingzoo support (#494)
Co-authored-by: Rodrigo de Lazcano <r.l.p.v96@gmail.com>
Co-authored-by: J K Terry <justinkterry@gmail.com>
2022-02-15 22:56:45 +08:00

22 lines
443 B
Python

import pprint
from pistonball import get_args, train_agent, watch
def test_piston_ball(args=get_args()):
if args.watch:
watch(args)
return
result, agent = train_agent(args)
# assert result["best_reward"] >= args.win_rate
if __name__ == '__main__':
pprint.pprint(result)
# Let's watch its performance!
watch(args, agent)
if __name__ == '__main__':
test_piston_ball(get_args())