Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Seminar-HFO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
Seminar-HFO
Commits
21b0fe35
You need to sign in or sign up before continuing.
Commit
21b0fe35
authored
Oct 20, 2015
by
Matthew Hausknecht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in launching agents.
parent
f8ec967c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
+15
-19
bin/Trainer.py
bin/Trainer.py
+15
-19
No files found.
bin/Trainer.py
View file @
21b0fe35
...
@@ -365,7 +365,7 @@ class Trainer(object):
...
@@ -365,7 +365,7 @@ class Trainer(object):
server.
server.
"""
"""
print
'Wait on player'
,
player_num
,
on_offense
#
print 'Wait on player', player_num, on_offense
self
.
send
(
'(look)'
)
self
.
send
(
'(look)'
)
partial
=
[
'ok'
,
'look'
]
partial
=
[
'ok'
,
'look'
]
self
.
_numPlayers
=
0
self
.
_numPlayers
=
0
...
@@ -433,15 +433,13 @@ class Trainer(object):
...
@@ -433,15 +433,13 @@ class Trainer(object):
# Launch offense
# Launch offense
agent_num
=
0
agent_num
=
0
for
player_num
in
xrange
(
1
,
12
):
for
player_num
in
xrange
(
1
,
12
):
if
agent_num
<
self
.
_offenseAgents
:
if
agent_num
<
self
.
_offenseAgents
and
player_num
==
sorted_offense_agent_unums
[
agent_num
]:
agent_ext_num
=
sorted_offense_agent_unums
[
agent_num
]
port
=
self
.
_agentServerPort
+
agent_num
if
agent_ext_num
==
player_num
:
agent
=
self
.
launch_agent
(
agent_num
,
sorted_offense_agent_unums
[
agent_num
],
port
=
self
.
_agentServerPort
+
agent_num
play_offense
=
True
,
port
=
port
)
agent
=
self
.
launch_agent
(
agent_num
,
agent_ext_num
,
self
.
_agentPopen
.
append
(
agent
)
play_offense
=
True
,
port
=
port
)
necProcesses
.
append
([
agent
,
'offense_agent_'
+
str
(
agent_num
)])
self
.
_agentPopen
.
append
(
agent
)
agent_num
+=
1
necProcesses
.
append
([
agent
,
'offense_agent_'
+
str
(
agent_num
)])
agent_num
+=
1
else
:
else
:
player
=
self
.
launch_npc
(
player_num
,
play_offense
=
True
)
player
=
self
.
launch_npc
(
player_num
,
play_offense
=
True
)
if
player_num
in
offense_unums
:
if
player_num
in
offense_unums
:
...
@@ -454,15 +452,13 @@ class Trainer(object):
...
@@ -454,15 +452,13 @@ class Trainer(object):
# Launch defense
# Launch defense
agent_num
=
0
agent_num
=
0
for
player_num
in
xrange
(
1
,
12
):
for
player_num
in
xrange
(
1
,
12
):
if
agent_num
<
self
.
_defenseAgents
:
if
agent_num
<
self
.
_defenseAgents
and
player_num
==
sorted_defense_agent_unums
[
agent_num
]:
agent_ext_num
=
sorted_offense_agent_unums
[
agent_num
]
port
=
self
.
_agentServerPort
+
agent_num
+
self
.
_offenseAgents
if
agent_ext_num
==
player_num
:
agent
=
self
.
launch_agent
(
agent_num
,
sorted_defense_agent_unums
[
agent_num
],
port
=
self
.
_agentServerPort
+
agent_num
+
self
.
_offenseAgents
play_offense
=
False
,
port
=
port
)
agent
=
self
.
launch_agent
(
agent_num
,
agent_ext_num
,
self
.
_agentPopen
.
append
(
agent
)
play_offense
=
False
,
port
=
port
)
necProcesses
.
append
([
agent
,
'defense_agent_'
+
str
(
agent_num
)])
self
.
_agentPopen
.
append
(
agent
)
agent_num
+=
1
necProcesses
.
append
([
agent
,
'defense_agent_'
+
str
(
agent_num
)])
agent_num
+=
1
else
:
else
:
player
=
self
.
launch_npc
(
player_num
,
play_offense
=
False
)
player
=
self
.
launch_npc
(
player_num
,
play_offense
=
False
)
if
player_num
in
defense_unums
:
if
player_num
in
defense_unums
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment