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
a5513ec8
Commit
a5513ec8
authored
Jul 11, 2017
by
drallensmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve help on python agents; add *.o to .gitignore
parent
71a86f1a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
10 deletions
+13
-10
.gitignore
.gitignore
+1
-0
example/high_level_custom_agent.py
example/high_level_custom_agent.py
+8
-5
example/high_level_random_agent.py
example/high_level_random_agent.py
+4
-2
example/make_hand_coded_defense_agent_executable.sh
example/make_hand_coded_defense_agent_executable.sh
+0
-3
No files found.
.gitignore
View file @
a5513ec8
...
@@ -5,6 +5,7 @@ __pycache__/
...
@@ -5,6 +5,7 @@ __pycache__/
# C extensions
# C extensions
*.so
*.so
*.a
*.a
*.o
# Distribution / packaging
# Distribution / packaging
.Python
.Python
...
...
example/high_level_custom_agent.py
View file @
a5513ec8
...
@@ -16,7 +16,7 @@ params = {'SHT_DST':0.136664020547, 'SHT_ANG':-0.747394386098,
...
@@ -16,7 +16,7 @@ params = {'SHT_DST':0.136664020547, 'SHT_ANG':-0.747394386098,
'PASS_ANG'
:
0.464086704478
,
'DRIB_DST'
:
-
0.999052871962
}
'PASS_ANG'
:
0.464086704478
,
'DRIB_DST'
:
-
0.999052871962
}
def
can_shoot
(
goal_dist
,
goal_angle
):
def
can_shoot
(
goal_dist
,
goal_angle
):
"""Returns True if if player
can have a good shot at
goal"""
"""Returns True if if player
may have a good shot at the
goal"""
return
bool
((
goal_dist
<
params
[
'SHT_DST'
])
and
(
goal_angle
>
params
[
'SHT_ANG'
]))
return
bool
((
goal_dist
<
params
[
'SHT_DST'
])
and
(
goal_angle
>
params
[
'SHT_ANG'
]))
def
has_better_pos
(
dist_to_op
,
goal_angle
,
pass_angle
,
curr_goal_angle
):
def
has_better_pos
(
dist_to_op
,
goal_angle
,
pass_angle
,
curr_goal_angle
):
...
@@ -63,10 +63,13 @@ def get_action(state,hfo_env,num_teammates,rand_pass):
...
@@ -63,10 +63,13 @@ def get_action(state,hfo_env,num_teammates,rand_pass):
def
main
():
def
main
():
parser
=
argparse
.
ArgumentParser
()
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'--port'
,
type
=
int
,
default
=
6000
)
parser
.
add_argument
(
'--port'
,
type
=
int
,
default
=
6000
,
help
=
"Server port"
)
parser
.
add_argument
(
'--seed'
,
type
=
int
,
default
=
None
)
parser
.
add_argument
(
'--seed'
,
type
=
int
,
default
=
None
,
parser
.
add_argument
(
'--rand-pass'
,
type
=
bool
,
default
=
False
)
help
=
"Seed for randomization; uses machine default if 0 or not given"
)
parser
.
add_argument
(
'--eps'
,
type
=
float
,
default
=
0
)
parser
.
add_argument
(
'--rand-pass'
,
action
=
"store_true"
,
help
=
"Randomize order of checking teammates for a possible pass"
)
parser
.
add_argument
(
'--eps'
,
type
=
float
,
default
=
0
,
help
=
"Probability of a random action if has the ball, to adjust difficulty"
)
parser
.
add_argument
(
'--numTeammates'
,
type
=
int
,
default
=
0
)
parser
.
add_argument
(
'--numTeammates'
,
type
=
int
,
default
=
0
)
parser
.
add_argument
(
'--numOpponents'
,
type
=
int
,
default
=
1
)
parser
.
add_argument
(
'--numOpponents'
,
type
=
int
,
default
=
1
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
...
...
example/high_level_random_agent.py
View file @
a5513ec8
...
@@ -16,8 +16,10 @@ except ImportError:
...
@@ -16,8 +16,10 @@ except ImportError:
def
main
():
def
main
():
parser
=
argparse
.
ArgumentParser
()
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'--port'
,
type
=
int
,
default
=
6000
)
parser
.
add_argument
(
'--port'
,
type
=
int
,
default
=
6000
,
parser
.
add_argument
(
'--seed'
,
type
=
int
,
default
=
None
)
help
=
"Server port"
)
parser
.
add_argument
(
'--seed'
,
type
=
int
,
default
=
None
,
help
=
"Randomization seed (uses machine default if 0 or not given"
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
if
args
.
seed
:
if
args
.
seed
:
random
.
seed
(
args
.
seed
)
random
.
seed
(
args
.
seed
)
...
...
example/make_hand_coded_defense_agent_executable.sh
deleted
100755 → 0
View file @
71a86f1a
# Run this file to create an executable of hand_coded_defense_agent.cpp
g++
-c
hand_coded_defense_agent.cpp
-I
../src/
-std
=
c++0x
-pthread
g++
-L
../lib/ hand_coded_defense_agent.o
-lhfo
-pthread
-o
hand_coded_defense_agent
-Wl
,-rpath,../lib
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