13 lines
415 B
C
13 lines
415 B
C
|
|
#pragma once
|
||
|
|
#include <TestProject/RNG/model/IModel.h>
|
||
|
|
#include <TestProject/RNG/RandT.h>
|
||
|
|
#include <nlohmann/json.hpp>
|
||
|
|
using json = nlohmann::json;
|
||
|
|
|
||
|
|
struct UniformModel : IModel {
|
||
|
|
float center, delta;
|
||
|
|
UniformModel(const json& params, float defaultVal)
|
||
|
|
: center(defaultVal), delta(params.value("delta", 0.01f)) {}
|
||
|
|
float evaluate(size_t) override { return RandT::RandT(center - delta, center + delta); }
|
||
|
|
};
|