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
0212bbe5
You need to sign in or sign up before continuing.
Commit
0212bbe5
authored
Jul 07, 2017
by
drallensmith
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into add_preprocess_action - avoid rebase
parents
3785b072
bdc7504c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
2 deletions
+35
-2
.travis.yml
.travis.yml
+1
-1
src/lowlevel_feature_extractor.cpp
src/lowlevel_feature_extractor.cpp
+33
-0
src/lowlevel_feature_extractor.h
src/lowlevel_feature_extractor.h
+1
-1
No files found.
.travis.yml
View file @
0212bbe5
...
@@ -22,4 +22,4 @@ compiler:
...
@@ -22,4 +22,4 @@ compiler:
-
gcc
-
gcc
script
:
script
:
-
mkdir build && cd build
-
mkdir build && cd build
-
cmake -DCMAKE_BUILD_TYPE=Rel
ease
.. && make -j4 && make install
-
cmake -DCMAKE_BUILD_TYPE=Rel
withDebInfo
.. && make -j4 && make install
src/lowlevel_feature_extractor.cpp
View file @
0212bbe5
...
@@ -16,6 +16,7 @@ LowLevelFeatureExtractor::LowLevelFeatureExtractor(int num_teammates,
...
@@ -16,6 +16,7 @@ LowLevelFeatureExtractor::LowLevelFeatureExtractor(int num_teammates,
assert
(
numOpponents
>=
0
);
assert
(
numOpponents
>=
0
);
numFeatures
=
num_basic_features
+
numFeatures
=
num_basic_features
+
features_per_player
*
(
numTeammates
+
numOpponents
);
features_per_player
*
(
numTeammates
+
numOpponents
);
numFeatures
+=
numTeammates
+
numOpponents
;
// Uniform numbers
feature_vec
.
resize
(
numFeatures
);
feature_vec
.
resize
(
numFeatures
);
}
}
...
@@ -184,6 +185,38 @@ const std::vector<float>& LowLevelFeatureExtractor::ExtractFeatures(
...
@@ -184,6 +185,38 @@ const std::vector<float>& LowLevelFeatureExtractor::ExtractFeatures(
addFeature
(
0
);
addFeature
(
0
);
}
}
}
}
// ========================= UNIFORM NUMBERS ========================== //
detected_teammates
=
0
;
for
(
PlayerPtrCont
::
const_iterator
it
=
teammates
.
begin
();
it
!=
teammates
.
end
();
++
it
)
{
PlayerObject
*
teammate
=
*
it
;
if
(
teammate
->
pos
().
x
>
0
&&
teammate
->
unum
()
>
0
&&
detected_teammates
<
numTeammates
)
{
addFeature
(
teammate
->
unum
());
detected_teammates
++
;
}
}
// Add zero features for any missing teammates
for
(
int
i
=
detected_teammates
;
i
<
numTeammates
;
++
i
)
{
addFeature
(
0
);
}
detected_opponents
=
0
;
for
(
PlayerPtrCont
::
const_iterator
it
=
opponents
.
begin
();
it
!=
opponents
.
end
();
++
it
)
{
PlayerObject
*
opponent
=
*
it
;
if
(
opponent
->
pos
().
x
>
0
&&
opponent
->
unum
()
>
0
&&
detected_opponents
<
numOpponents
)
{
addFeature
(
opponent
->
unum
());
detected_opponents
++
;
}
}
// Add zero features for any missing opponents
for
(
int
i
=
detected_opponents
;
i
<
numOpponents
;
++
i
)
{
addFeature
(
0
);
}
assert
(
featIndx
==
numFeatures
);
assert
(
featIndx
==
numFeatures
);
checkFeatures
();
checkFeatures
();
return
feature_vec
;
return
feature_vec
;
...
...
src/lowlevel_feature_extractor.h
View file @
0212bbe5
...
@@ -17,7 +17,7 @@ public:
...
@@ -17,7 +17,7 @@ public:
protected:
protected:
// Number of features for non-player objects.
// Number of features for non-player objects.
const
static
int
num_basic_features
=
58
;
const
static
int
num_basic_features
=
58
;
// Number of features for each player or opponent in game.
// Number of features for each player or opponent in game
, not including uniform numbers
.
const
static
int
features_per_player
=
8
;
const
static
int
features_per_player
=
8
;
};
};
...
...
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