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