23 #include "Validator/ObjectRequirement.h"
24 #include "Drivers/DriverException.h"
25 #include "PairwiseKernel.h"
32 auto type = json.get(
"type",
"none").asString();
33 if(type ==
"gaussian")
35 else if(type ==
"rationalswitch")
38 throw std::invalid_argument(
"Invalid pairwise kernel type \"" + type +
"\".");
53 reader.parse(JsonSchema::GaussianPK, schema);
54 validator.
Parse(schema, path);
62 json[
"mu"].asDouble(),
63 json[
"sigma"].asDouble()
80 reader.parse(JsonSchema::RationalSwitchPK, schema);
81 validator.
Parse(schema, path);
88 json[
"d0"].asDouble(),
89 json[
"r0"].asDouble(),
bool HasErrors()
Check if errors have occured.
static RationalSwitchPK * Build(const Json::Value &json, const std::string &path)
Build RationalSwitchPK from JSON value.
RationalSwitchPK(double d0, double r0, int n, int m)
Constructor.
virtual void Parse(Value json, const std::string &path) override
Parse JSON value to generate Requirement(s).
Exception to be thrown when building the Driver fails.
std::vector< std::string > GetErrors()
Get list of error messages.
static GaussianPK * Build(const Json::Value &json, const std::string &path)
Build GaussianPK from JSON value.
Requirements on an object.
Pairwise kernel base class.
GaussianPK(double mu, double sigma)
Constructor.
Rational Switching Function.
virtual void Validate(const Value &json, const std::string &path) override
Validate JSON value.
static PairwiseKernel * Build(const Json::Value &json, const std::string &path)
Build PairwiseKernel from JSON value.