Commit bdc7504c authored by drallensmith's avatar drallensmith

Uniform numbers added; .travis.yml for RelwithDebInfo (see earlier re cmake);...

Uniform numbers added; .travis.yml for RelwithDebInfo (see earlier re cmake); will create test script next
parent 62e39c85
......@@ -22,4 +22,4 @@ compiler:
- gcc
script:
- mkdir build && cd build
- cmake -DCMAKE_BUILD_TYPE=Release .. && make -j4 && make install
- cmake -DCMAKE_BUILD_TYPE=RelwithDebInfo .. && make -j4 && make install
......@@ -16,6 +16,7 @@ LowLevelFeatureExtractor::LowLevelFeatureExtractor(int num_teammates,
assert(numOpponents >= 0);
numFeatures = num_basic_features +
features_per_player * (numTeammates + numOpponents);
numFeatures += numTeammates + numOpponents; // Uniform numbers
feature_vec.resize(numFeatures);
}
......@@ -184,6 +185,38 @@ const std::vector<float>& LowLevelFeatureExtractor::ExtractFeatures(
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);
checkFeatures();
return feature_vec;
......
......@@ -17,7 +17,7 @@ public:
protected:
// Number of features for non-player objects.
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;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment