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
d2bf0deb
Commit
d2bf0deb
authored
Dec 19, 2015
by
Matthew Hausknecht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
listenAndProcess now ignores timeout error.
parent
868d3c4b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
bin/Trainer.py
bin/Trainer.py
+8
-5
example/high_level_random_agent.cpp
example/high_level_random_agent.cpp
+1
-1
No files found.
bin/Trainer.py
View file @
d2bf0deb
...
...
@@ -342,10 +342,13 @@ class Trainer(object):
def
listenAndProcess
(
self
,
retry_count
=
None
):
""" Gather messages and process them. """
msg
=
self
.
recv
(
retry_count
)
assert
((
msg
[
0
]
==
'('
)
and
(
msg
[
-
1
]
==
')'
)),
'|
%
s|'
%
msg
msg
=
self
.
parseMsg
(
msg
)
self
.
handleMsg
(
msg
)
try
:
msg
=
self
.
recv
(
retry_count
)
assert
((
msg
[
0
]
==
'('
)
and
(
msg
[
-
1
]
==
')'
)),
'|
%
s|'
%
msg
msg
=
self
.
parseMsg
(
msg
)
self
.
handleMsg
(
msg
)
except
TimeoutError
:
pass
def
disconnectPlayer
(
self
,
player
,
player_num
,
on_offense
):
"""Wait on a launched player to disconnect from the server. """
...
...
@@ -470,7 +473,7 @@ class Trainer(object):
necDef
=
set
([(
self
.
_defenseTeamName
,
str
(
x
))
for
x
in
sorted_defense_agent_unums
])
necAgents
=
necOff
.
union
(
necDef
)
while
self
.
checkLive
(
necProcesses
)
and
self
.
_agentReady
!=
necAgents
:
self
.
listenAndProcess
(
10
)
self
.
listenAndProcess
()
# Broadcast the HFO configuration
offense_nums
=
' '
.
join
([
str
(
self
.
convertToExtPlayer
(
self
.
_offenseTeamName
,
i
))
...
...
example/high_level_random_agent.cpp
View file @
d2bf0deb
...
...
@@ -11,7 +11,7 @@ using namespace hfo;
// Returns a random high-level action
action_t
get_random_high_lv_action
()
{
action_t
action_indx
=
(
action_t
)
((
rand
()
%
4
)
+
MOVE
);
action_t
action_indx
=
(
action_t
)
((
rand
()
%
5
)
+
MOVE
);
return
action_indx
;
}
...
...
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