1 #include "KneeTimeScaleController.hpp" 5 KneeTimeScaleController::KneeTimeScaleController(
12 bool writeTimeScaleFieldnames,
16 : AdaptiveTimeScaleController(
23 writeTimeScaleFieldnames,
25 mKneeThresh = kneeThresh;
26 mKneeSlope = kneeSlope;
30 KneeTimeScaleController::calcTimesteps(
double timeValue, std::vector<double>
const &rawTimeScales) {
32 std::vector<double> timeScales(
33 AdaptiveTimeScaleController::calcTimesteps(timeValue, rawTimeScales));
35 for (
int i = 0; i < timeScales.size(); ++i) {
37 if (mTimeScaleInfo.mTimeScaleMax[i] > mKneeThresh) {
38 mTimeScaleInfo.mTimeScaleMax[i] =
39 mOldTimeScaleInfo.mTimeScaleMax[i]
40 + (mTimeScaleInfo.mTimeScaleMax[i] - mOldTimeScaleInfo.mTimeScaleMax[i])
43 timeScales[i] = std::min(timeScales[i], mTimeScaleInfo.mTimeScaleMax[i]);