Commit 782302e4 authored by Matthew Hausknecht's avatar Matthew Hausknecht Committed by GitHub

Merge pull request #78 from CoolPhilChen/for_pull_request

Add an HFO flag to switch on/off determinism
parents b3137796 ed256670
...@@ -93,6 +93,12 @@ def main(args): ...@@ -93,6 +93,12 @@ def main(args):
args.messageSize, args.messageSize,
args.verbose) args.verbose)
if args.deterministic:
serverOptions += ' server::player_rand=0 ' \
'server::ball_rand=0 ' \
'server::kick_rand=0 ' \
'server::wind_rand=0'
try: try:
signal.signal(signal.SIGTERM, term) signal.signal(signal.SIGTERM, term)
except (ValueError, AttributeError): except (ValueError, AttributeError):
...@@ -202,6 +208,8 @@ def parseArgs(): ...@@ -202,6 +208,8 @@ def parseArgs():
help='Ball initialization max y position: [-1,1]. Default: 0.8') help='Ball initialization max y position: [-1,1]. Default: 0.8')
p.add_argument('--verbose', dest='verbose', action='store_true', p.add_argument('--verbose', dest='verbose', action='store_true',
default=False, help='Print verbose output.') default=False, help='Print verbose output.')
p.add_argument('--deterministic', dest='deterministic', action='store_true',
default=False, help='Make environment deterministic.')
args = p.parse_args() args = p.parse_args()
if args.offenseAgents not in list(range(0, 11)): if args.offenseAgents not in list(range(0, 11)):
p.error('argument --offense-agents: invalid choice: '\ p.error('argument --offense-agents: invalid choice: '\
......
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