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
b8b2a1d4
Commit
b8b2a1d4
authored
May 25, 2020
by
Matthew Hausknecht
Committed by
GitHub
May 25, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #97 from saikalyan9981/patch-1
Corrections in getting unum and purgeFeatures
parents
85a7d957
34cd61f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
example/sarsa_defense/high_level_sarsa_defense_agent.cpp
example/sarsa_defense/high_level_sarsa_defense_agent.cpp
+8
-2
No files found.
example/sarsa_defense/high_level_sarsa_defense_agent.cpp
View file @
b8b2a1d4
...
@@ -48,11 +48,17 @@ void purgeFeatures(double *state, const std::vector<float>& state_vec,
...
@@ -48,11 +48,17 @@ void purgeFeatures(double *state, const std::vector<float>& state_vec,
int
stateIndex
=
0
;
int
stateIndex
=
0
;
// Features[0 - 9] - {5,8}=8
// Features[9+T+1 - 9+2T]: teammates dists to closest opps=T
// Features [9+3T+1 - 9+6T]: x, y, unum of teammates ignoring %3 -> unum of team mates=2T
// Features [9+6T+1 - 9+6T+3*O]: x, y, unum of opponents ignoring %3 -> unum of opponents=20
// Ignored: Feature [ 9+6T+3O+1, 9+6T+3O+2]: last_action_status,stamina->2
// If no opponents ignore features Distance to Opponent
// If no opponents ignore features Distance to Opponent
// and Distance from Teammate i to Opponent are absent
// and Distance from Teammate i to Opponent are absent
int
tmpIndex
=
oppPres
?
(
9
+
3
*
numTMates
)
:
(
9
+
2
*
numTMates
);
int
tmpIndex
=
oppPres
?
(
9
+
3
*
numTMates
)
:
(
9
+
2
*
numTMates
);
for
(
int
i
=
0
;
i
<
state_vec
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
state_vec
.
size
()
-
2
;
i
++
)
{
// Ignore first six featues
// Ignore first six featues
if
(
i
==
5
||
i
==
8
)
continue
;
if
(
i
==
5
||
i
==
8
)
continue
;
...
@@ -167,7 +173,7 @@ void offenseAgent(int port, int numTMates, int numOpponents, int numEpi, double
...
@@ -167,7 +173,7 @@ void offenseAgent(int port, int numTMates, int numOpponents, int numEpi, double
// Get hfo::Action
// Get hfo::Action
a
=
toAction
(
action
,
state_vec
);
a
=
toAction
(
action
,
state_vec
);
if
(
a
==
hfo
::
MARK_PLAYER
)
{
if
(
a
==
hfo
::
MARK_PLAYER
)
{
unum
=
state_vec
[(
state_vec
.
size
()
-
1
-
(
action
-
5
)
*
3
)];
unum
=
state_vec
[(
state_vec
.
size
()
-
1
-
2
-
(
action
-
5
)
*
3
)];
hfo
.
act
(
a
,
unum
);
hfo
.
act
(
a
,
unum
);
}
else
{
}
else
{
hfo
.
act
(
a
);
hfo
.
act
(
a
);
...
...
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