12#ifndef P6DOFTUNERGASPECIMEN_HPP
13#define P6DOFTUNERGASPECIMEN_HPP
15#include "p6dof_export.h"
20#include "UtRandom.hpp"
36 void GenerateChromosome();
38 void Mutate(
double aMutationProbability);
50 void SetKpRange(
double aLowerBound,
double aUpperBound);
53 void SetKiRange(
double aLowerBound,
double aUpperBound);
56 void SetKdRange(
double aLowerBound,
double aUpperBound);
59 void SetRandomPtr(ut::Random* aRandom);
62 double GetKp()
const {
return std::pow(10.0, mLogKp); }
65 double GetKi()
const {
return std::pow(10.0, mLogKi); }
68 double GetKd()
const {
return std::pow(10.0, mLogKd); }
71 void DetermineChromosomeLengths();
72 std::string IntToBinString(
size_t aInt,
size_t aLength);
73 unsigned int BinStringToInt(
const std::string& aBinString);
74 void UpdateBasedOnChromosome();
76 static const double cDefaultLogKpRange[2];
77 static const double cDefaultLogKiRange[2];
78 static const double cDefaultLogKdRange[2];
80 double mObjectiveValue;
81 double mLogKp, mLogKi, mLogKd;
82 double mLogKpRange[2];
83 double mLogKiRange[2];
84 double mLogKdRange[2];
85 std::string mChromosome;
86 size_t mChromosomeLengths[3];
89 double mOvershootWeight;
90 ut::Random* mRandomPtr =
nullptr;
Definition P6DofTunerGASpecimen.hpp:23
double GetObjectiveValue() const
Definition P6DofTunerGASpecimen.hpp:35
double GetErrorWeight() const
Definition P6DofTunerGASpecimen.hpp:43
void GenerateSpecimen()
Definition P6DofTunerGASpecimen.cpp:47
void SetOvershootWeight(double aOvershootWeight)
Definition P6DofTunerGASpecimen.hpp:46
double GetKd() const
Definition P6DofTunerGASpecimen.hpp:68
double AssessObjective(std::vector< PidLogElement > &aSimData)
Definition P6DofTunerGASpecimen.cpp:84
void SetErrorWeight(double aErrorWeight)
Definition P6DofTunerGASpecimen.hpp:42
double GetKi() const
Definition P6DofTunerGASpecimen.hpp:65
std::string GetChromosome() const
Definition P6DofTunerGASpecimen.hpp:37
double GetKp() const
Definition P6DofTunerGASpecimen.hpp:62
double GetOvershootWeight() const
Definition P6DofTunerGASpecimen.hpp:47
P6DofTunerGASpecimen()
Definition P6DofTunerGASpecimen.cpp:24
Definition P6DofVehicleData.hpp:152
Definition P6DofTunerGASpecimen.hpp:26
P6DOF::SinglePidValueData pidValues
Definition P6DofTunerGASpecimen.hpp:27
double timeStamp
Definition P6DofTunerGASpecimen.hpp:28