45 return std::make_shared<vpFixedTemporalWeighting>(j.get<
double>());
47 else if (j.is_object()) {
48 bool slopeIncreasing = j.value(
"increasing",
true);
49 double slopePower = j.value(
"slopePower", 1.0);
51 if ((!slopeIncreasing && slopePower > 0.0) || (slopeIncreasing && slopePower < 0.0)) {
52 slopePower = -slopePower;
54 return std::make_shared<vpSigmoidTemporalWeighting>(
55 j.value(
"minWeight", 0.0),
56 j.value(
"maxWeight", 1.0),
57 j.value(
"midpointLocation", 0.5),
81 if (progress == 0.0 || m_location == 1.0) {
90 double f1 = m_location / progress;
91 double f2 = (1.0 - progress) / (1.0 - m_location);
93 w = (1.0 / (1.0 + (std::pow(f1 * f2, m_power))));
95 return m_minWeight + w * (m_maxWeight - m_minWeight);