Skip to content

Commit

Permalink
Named constants
Browse files Browse the repository at this point in the history
  • Loading branch information
angellareo committed Mar 30, 2021
1 parent af54fe7 commit 2726f72
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion include/ElectromotorModelSimulator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <utility>
#include <vector>

// Define parameters for GA evaluation function
#define PATTERN_NORMALIZATION_X_VALUE 1000
#define PATTERN_INTERPOLATION_STEP 20

class ElectromotorModelSimulator {
private:
std::unique_ptr<ElectromotorModel> _model;
Expand Down Expand Up @@ -116,7 +120,8 @@ class ElectromotorModelSimulator {
float ret = 0.0, minRet = INT_MAX;

for (unsigned int patI = 0; patI < patternIPIs[pattern].size(); ++patI) {
int newMaxX = 1000, interpStep = 20;
int newMaxX = PATTERN_NORMALIZATION_X_VALUE,
interpStep = PATTERN_INTERPOLATION_STEP;

std::vector<int> normIPIs = _normalize(_IPIs[pattern], newMaxX);
std::vector<int> normPatIPIs =
Expand Down
7 changes: 6 additions & 1 deletion include/ElectromotorModelStd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "ModelOutput.hpp"

// Random initialization time range
#define MIN_TIME_RANDOM_INIT 300
#define MAX_TIME_RANDOM_INIT 500

template <typename ProblemConfigType>
class ElectromotorModelStd {
public:
Expand Down Expand Up @@ -74,7 +78,8 @@ class ElectromotorModelStd {
std::unique_ptr<ModelOutput> _out;

std::default_random_engine _getRand;
std::uniform_int_distribution<int> _timeRange{30, 60};
std::uniform_int_distribution<int> _timeRange{MIN_TIME_RANDOM_INIT,
MAX_TIME_RANDOM_INIT};

struct iExtNeurons {
double VPd;
Expand Down

0 comments on commit 2726f72

Please sign in to comment.