trying to initialize env_type var in same header
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
# Anything not in this list will not be compiled into mlpack.
|
||||
set(SOURCES
|
||||
env_type.hpp
|
||||
env_type.cpp
|
||||
mountain_car.hpp
|
||||
cart_pole.hpp
|
||||
continuous_mountain_car.hpp
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/**
|
||||
* @file methods/reinforcement_learning/environment/env_type.cpp
|
||||
* @author Nishant Kumar
|
||||
*
|
||||
* This file defines the static variables used by the discrete and continuous
|
||||
* environments.
|
||||
*
|
||||
* mlpack is free software; you may redistribute it and/or modify it under the
|
||||
* terms of the 3-clause BSD license. You should have received a copy of the
|
||||
* 3-clause BSD license along with mlpack. If not, see
|
||||
* http://www.opensource.org/licenses/BSD-3-Clause for more information.
|
||||
*/
|
||||
#include "env_type.hpp"
|
||||
|
||||
namespace mlpack {
|
||||
namespace rl {
|
||||
|
||||
// Instantiate static members.
|
||||
|
||||
size_t DiscreteActionEnv::State::dimension = 0;
|
||||
size_t DiscreteActionEnv::Action::size = 0;
|
||||
size_t DiscreteActionEnv::rewardSize = 0;
|
||||
|
||||
size_t ContinuousActionEnv::State::dimension = 0;
|
||||
size_t ContinuousActionEnv::Action::size = 0;
|
||||
size_t ContinuousActionEnv::rewardSize = 0;
|
||||
|
||||
} // namespace rl
|
||||
} // namespace mlpack
|
||||
@@ -206,6 +206,19 @@ class ContinuousActionEnv
|
||||
static size_t rewardSize;
|
||||
};
|
||||
|
||||
#ifndef MLPACK_METHODS_RL_ENVIRONMENT_ENV_TYPE_VARIABLES
|
||||
#define MLPACK_METHODS_RL_ENVIRONMENT_ENV_TYPE_VARIABLES
|
||||
|
||||
size_t DiscreteActionEnv::State::dimension = 0;
|
||||
size_t DiscreteActionEnv::Action::size = 0;
|
||||
size_t DiscreteActionEnv::rewardSize = 0;
|
||||
|
||||
size_t ContinuousActionEnv::State::dimension = 0;
|
||||
size_t ContinuousActionEnv::Action::size = 0;
|
||||
size_t ContinuousActionEnv::rewardSize = 0;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace rl
|
||||
} // namespace mlpack
|
||||
|
||||
|
||||
Reference in New Issue
Block a user