12 lines
365 B
C
12 lines
365 B
C
#pragma once
|
|
#include <TestProject/RNG/model/IModel.h>
|
|
#include <nlohmann/json.hpp>
|
|
using json = nlohmann::json;
|
|
|
|
struct DriftModel : IModel {
|
|
float base, drift_rate;
|
|
DriftModel(const json& params, float defaultVal)
|
|
: base(defaultVal), drift_rate(params.value("drift_rate", 0.0f)) {}
|
|
float evaluate(size_t t) override { return base + drift_rate * t; }
|
|
};
|