Commit 4b702be9 authored by Matthew Hausknecht's avatar Matthew Hausknecht

Constexpr updates for c++11.

parent 603077ea
...@@ -68,7 +68,7 @@ const int ANGLE_DIVS = 40; ...@@ -68,7 +68,7 @@ const int ANGLE_DIVS = 40;
*/ */
struct DeflectingEvaluator { struct DeflectingEvaluator {
static const double not_shoot_ball_eval = 10000; constexpr static const double not_shoot_ball_eval = 10000;
double operator()( const WorldModel & wm, double operator()( const WorldModel & wm,
TackleGenerator::TackleResult & result ) const TackleGenerator::TackleResult & result ) const
......
...@@ -110,21 +110,21 @@ protected: ...@@ -110,21 +110,21 @@ protected:
void checkFeatures(); void checkFeatures();
protected: protected:
const static float RAD_T_DEG = 180.0 / M_PI; constexpr static float RAD_T_DEG = 180.0 / M_PI;
const static float ALLOWED_PITCH_FRAC = 0.33; constexpr static float ALLOWED_PITCH_FRAC = 0.33;
int featIndx; int featIndx;
std::vector<float> feature_vec; // Contains the current features std::vector<float> feature_vec; // Contains the current features
const static float FEAT_MIN = -1; constexpr static float FEAT_MIN = -1;
const static float FEAT_MAX = 1; constexpr static float FEAT_MAX = 1;
const static float FEAT_INVALID = -2; constexpr static float FEAT_INVALID = -2;
int numFeatures; // Total number of features int numFeatures; // Total number of features
// Observed values of some parameters. // Observed values of some parameters.
const static float observedSelfSpeedMax = 0.46; constexpr static float observedSelfSpeedMax = 0.46;
const static float observedPlayerSpeedMax = 0.75; constexpr static float observedPlayerSpeedMax = 0.75;
const static float observedStaminaMax = 8000.; constexpr static float observedStaminaMax = 8000.;
const static float observedBallSpeedMax = 5.0; constexpr static float observedBallSpeedMax = 5.0;
float maxHFORadius; // Maximum possible distance in HFO playable region float maxHFORadius; // Maximum possible distance in HFO playable region
// Useful measures defined by the Server Parameters // Useful measures defined by the Server Parameters
float pitchLength, pitchWidth, pitchHalfLength, pitchHalfWidth, float pitchLength, pitchWidth, pitchHalfLength, pitchHalfWidth,
......
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