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
b06bf087
Commit
b06bf087
authored
Jul 15, 2017
by
drallensmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added function to high_level_custom_agent.py re teammates
parent
357fe5ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
example/high_level_custom_agent.py
example/high_level_custom_agent.py
+6
-6
example/python_agents_3v3.sh
example/python_agents_3v3.sh
+2
-2
No files found.
example/high_level_custom_agent.py
View file @
b06bf087
...
@@ -68,8 +68,6 @@ def main():
...
@@ -68,8 +68,6 @@ def main():
help
=
"If doing HFO --record"
)
help
=
"If doing HFO --record"
)
parser
.
add_argument
(
'--rdir'
,
type
=
str
,
default
=
'log/'
,
parser
.
add_argument
(
'--rdir'
,
type
=
str
,
default
=
'log/'
,
help
=
"Set directory to use if doing --record"
)
help
=
"Set directory to use if doing --record"
)
parser
.
add_argument
(
'--numTeammates'
,
type
=
int
,
default
=
0
)
parser
.
add_argument
(
'--numOpponents'
,
type
=
int
,
default
=
1
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
if
args
.
seed
:
if
args
.
seed
:
random
.
seed
(
args
.
seed
)
random
.
seed
(
args
.
seed
)
...
@@ -83,12 +81,14 @@ def main():
...
@@ -83,12 +81,14 @@ def main():
hfo_env
.
connectToServer
(
hfo
.
HIGH_LEVEL_FEATURE_SET
,
hfo_env
.
connectToServer
(
hfo
.
HIGH_LEVEL_FEATURE_SET
,
'bin/teams/base/config/formations-dt'
,
args
.
port
,
'bin/teams/base/config/formations-dt'
,
args
.
port
,
'localhost'
,
'base_left'
,
False
)
'localhost'
,
'base_left'
,
False
)
num_teammates
=
hfo_env
.
getNumTeammates
()
#num_opponents = hfo_env.getNumOpponents()
if
args
.
seed
:
if
args
.
seed
:
if
(
args
.
rand_pass
and
(
args
.
numT
eammates
>
1
))
or
(
args
.
epsilon
>
0
):
if
(
args
.
rand_pass
and
(
num_t
eammates
>
1
))
or
(
args
.
epsilon
>
0
):
print
(
"Python randomization seed: {0:d}"
.
format
(
args
.
seed
))
print
(
"Python randomization seed: {0:d}"
.
format
(
args
.
seed
))
else
:
else
:
print
(
"Python randomization seed useless without --rand-pass w/teammates or --epsilon >0"
)
print
(
"Python randomization seed useless without --rand-pass w/
2+
teammates or --epsilon >0"
)
if
args
.
rand_pass
and
(
args
.
numT
eammates
>
1
):
if
args
.
rand_pass
and
(
num_t
eammates
>
1
):
print
(
"Randomizing order of checking for a pass"
)
print
(
"Randomizing order of checking for a pass"
)
if
args
.
epsilon
>
0
:
if
args
.
epsilon
>
0
:
print
(
"Using epsilon {0:n}"
.
format
(
args
.
epsilon
))
print
(
"Using epsilon {0:n}"
.
format
(
args
.
epsilon
))
...
@@ -108,7 +108,7 @@ def main():
...
@@ -108,7 +108,7 @@ def main():
hfo_env
.
act
(
hfo
.
DRIBBLE
)
hfo_env
.
act
(
hfo
.
DRIBBLE
)
num_eps
+=
1
num_eps
+=
1
else
:
else
:
get_action
(
state
,
hfo_env
,
args
.
numT
eammates
,
args
.
rand_pass
)
get_action
(
state
,
hfo_env
,
num_t
eammates
,
args
.
rand_pass
)
num_had_ball
+=
1
num_had_ball
+=
1
else
:
else
:
hfo_env
.
act
(
hfo
.
MOVE
)
hfo_env
.
act
(
hfo
.
MOVE
)
...
...
example/python_agents_3v3.sh
View file @
b06bf087
...
@@ -3,9 +3,9 @@
...
@@ -3,9 +3,9 @@
./bin/HFO
--offense-agents
=
2
--defense-npcs
=
3
--offense-npcs
=
1
--trials
20
--headless
&
./bin/HFO
--offense-agents
=
2
--defense-npcs
=
3
--offense-npcs
=
1
--trials
20
--headless
&
sleep
5
sleep
5
# -x is needed to skip first line - otherwise whatever default python version is will run
# -x is needed to skip first line - otherwise whatever default python version is will run
python2.7
-x
./example/high_level_custom_agent.py
--
numTeammates
=
2
--numOpponents
=
3
--
port
6000 &> agent1.txt &
python2.7
-x
./example/high_level_custom_agent.py
--port
6000 &> agent1.txt &
sleep
5
sleep
5
python3
-x
./example/high_level_custom_agent.py
--
numTeammates
=
2
--numOpponents
=
3
--
port
6000 &> agent2.txt &
python3
-x
./example/high_level_custom_agent.py
--port
6000 &> agent2.txt &
# The magic line
# The magic line
# $$ holds the PID for this script
# $$ holds the PID for this script
...
...
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