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
9fbbf409
Commit
9fbbf409
authored
Jan 11, 2016
by
sanmit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor touchups
parent
d061c331
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1 addition
and
21 deletions
+1
-21
bin/HFO
bin/HFO
+1
-1
example/hfo_example_agent.py
example/hfo_example_agent.py
+0
-5
example/mid_level_move_agent.cpp
example/mid_level_move_agent.cpp
+0
-4
src/HFO.cpp
src/HFO.cpp
+0
-4
src/agent.cpp
src/agent.cpp
+0
-7
No files found.
bin/HFO
View file @
9fbbf409
...
...
@@ -140,7 +140,7 @@ def parseArgs():
help
=
'Server provides full-state information to agents.'
)
p
.
add_argument
(
'--seed'
,
dest
=
'seed'
,
type
=
int
,
default
=-
1
,
help
=
'Seed the server
\'
s RNG. Default: time.'
)
p
.
add_argument
(
'--message
S
ize'
,
dest
=
'messageSize'
,
type
=
int
,
default
=
1000
,
p
.
add_argument
(
'--message
-s
ize'
,
dest
=
'messageSize'
,
type
=
int
,
default
=
1000
,
help
=
'Message size limit for communication'
)
args
=
p
.
parse_args
()
if
args
.
offenseAgents
not
in
xrange
(
0
,
11
):
...
...
example/hfo_example_agent.py
View file @
9fbbf409
...
...
@@ -4,10 +4,7 @@
import
sys
# First Start the server: $> bin/start.py
if
__name__
==
'__main__'
:
port
=
6000
if
len
(
sys
.
argv
)
>
1
:
port
=
int
(
sys
.
argv
[
1
])
...
...
@@ -31,8 +28,6 @@ if __name__ == '__main__':
# Take an action and get the current game status
hfo
.
act
(
HFO_Actions
.
DASH
,
20.0
,
0
)
hfo
.
step
()
print
'Episode'
,
episode
,
'ended with'
,
# Check what the outcome of the episode was
if
status
==
HFO_Status
.
GOAL
:
...
...
example/mid_level_move_agent.cpp
View file @
9fbbf409
...
...
@@ -9,7 +9,6 @@ using namespace hfo;
// This agent demonstrates the use of the MOVE_TO action to visit the
// corners of the play field. Before running this program, first Start
// HFO server: $./bin/HFO --offense-agents 1
int
main
(
int
argc
,
char
**
argv
)
{
int
port
=
6000
;
if
(
argc
>
1
)
{
...
...
@@ -31,15 +30,12 @@ int main(int argc, char** argv) {
}
std
::
cout
<<
"target (x,y) = "
<<
target_x
<<
", "
<<
target_y
<<
std
::
endl
;
while
(
status
==
IN_GAME
)
{
// Get the vector of state features for the current state
const
vector
<
float
>&
feature_vec
=
hfo
.
getState
();
// Perform the action
hfo
.
act
(
MOVE_TO
,
target_x
,
target_y
);
// Advance the environment and get the game status
status
=
hfo
.
step
();
std
::
cout
<<
"Status: "
<<
status
<<
" (IN_GAME = "
<<
IN_GAME
<<
")
\n
"
;
}
}
hfo
.
act
(
QUIT
);
...
...
src/HFO.cpp
View file @
9fbbf409
...
...
@@ -207,9 +207,6 @@ void HFOEnvironment::connectToAgentServer(int server_port,
}
hear_msg
.
assign
(
&
(
hearMsgBuffer
[
0
]),
hearMsgBuffer
.
size
());
}
}
void
HFOEnvironment
::
handshakeAgentServer
(
feature_set_t
feature_set
)
{
...
...
@@ -363,7 +360,6 @@ status_t HFOEnvironment::step() {
}
hear_msg
.
assign
(
&
(
hearMsgBuffer
[
0
]),
hearMsgBuffer
.
size
());
}
return
game_status
;
}
...
...
src/agent.cpp
View file @
9fbbf409
...
...
@@ -125,7 +125,6 @@ Agent::Agent()
lastTeammateMessageTime
(
-
1
),
server_port
(
6008
),
client_connected
(
false
),
num_teammates
(
-
1
),
num_opponents
(
-
1
),
playing_offense
(
false
)
...
...
@@ -486,8 +485,6 @@ void Agent::actionImpl() {
exit
(
1
);
}
std
::
cout
<<
"[AGENT.CPP] Say message length "
<<
sayMsgLength
<<
std
::
endl
;
// Receive message
std
::
vector
<
char
>
sayMsgBuffer
;
sayMsgBuffer
.
resize
(
sayMsgLength
);
...
...
@@ -500,7 +497,6 @@ void Agent::actionImpl() {
exit
(
1
);
}
if
(
sayMsgLength
>
0
)
{
if
(
recv
(
newsockfd
,
&
sayMsgBuffer
[
0
],
sayMsgLength
,
0
)
<
0
){
perror
(
"[Agent Server] ERROR recv say message from socket"
);
close
(
sockfd
);
...
...
@@ -510,9 +506,6 @@ void Agent::actionImpl() {
// [Sanmit] "Say" in the actual game
addSayMessage
(
new
CustomMessage
(
msgString
));
std
::
cout
<<
"
\n\n
[AGENT SERVER] "
<<
msgString
<<
std
::
endl
;
}
...
...
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