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
127e88ae
You need to sign in or sign up before continuing.
Commit
127e88ae
authored
Jul 17, 2017
by
drallensmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Think have worked out random proportions for hand*py
parent
2e10799f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
example/defense_long_2v2.sh
example/defense_long_2v2.sh
+3
-1
example/defense_python_long_2v2.sh
example/defense_python_long_2v2.sh
+3
-1
example/hand_coded_defense_agent.py
example/hand_coded_defense_agent.py
+7
-6
No files found.
example/defense_long_2v2.sh
View file @
127e88ae
...
...
@@ -2,7 +2,9 @@
# HAS TO BE RUN FROM EXAMPLE DIR DUE TO hand_coded_defense_agent CONFIG!
../bin/HFO
--offense-npcs
=
2
--defense-agents
=
1
--defense-npcs
=
1
--trials
5000
--headless
--port
=
7000
--seed
1500310928
--no-logging
&
# Change to a new seed for different experiments!
../bin/HFO
--offense-npcs
=
2
--defense-agents
=
1
--defense-npcs
=
1
--trials
5000
--headless
--port
=
7000
--seed
1500348586
--no-logging
&
sleep
15
./hand_coded_defense_agent &> agent1.txt &
sleep
5
...
...
example/defense_python_long_2v2.sh
View file @
127e88ae
#!/bin/bash
./bin/HFO
--offense-npcs
=
2
--defense-agents
=
1
--defense-npcs
=
1
--trials
5000
--headless
--seed
1500310928
--no-logging
&
# Change to a different seed for different experiments!
./bin/HFO
--offense-npcs
=
2
--defense-agents
=
1
--defense-npcs
=
1
--trials
5000
--headless
--seed
1500348586
--no-logging
&
sleep
15
./example/hand_coded_defense_agent.py &> agent1.txt &
sleep
5
...
...
example/hand_coded_defense_agent.py
View file @
127e88ae
...
...
@@ -258,14 +258,15 @@ def do_defense_action(state_vec, hfo_env, episode,
def
do_random_defense_action
(
state
,
hfo_env
):
if
state
[
5
]
>
0
:
# kickable
if
random
.
random
()
<
0.5
:
hfo_env
.
act
(
hfo
.
INTERCEPT
)
hfo_env
.
act
(
random
.
choice
([
hfo
.
REDUCE_ANGLE_TO_GOAL
,
hfo
.
MOVE
,
HFO
.
GO_TO_BALL
]))
else
:
if
random
.
random
()
<
0.25
:
hfo_env
.
act
(
hfo
.
REDUCE_ANGLE_TO_GOAL
)
else
:
hfo_env
.
act
(
hfo
.
MOVE
)
else
:
hfo_env
.
act
(
random
.
choose
(
hfo
.
MOVE
,
hfo
.
DEFEND_GOAL
,
hfo
.
REDUCE_ANGLE_TO_GOAL
,
hfo
.
REDUCE_ANGLE_TO_GOAL
,
hfo
.
GO_TO_BALL
,
hfo
.
INTERCEPT
))
return
def
main
():
...
...
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