Commit f3b8346d authored by szymon's avatar szymon
Browse files

Adding default fallback value for reset_noise (0)

parent cd987fa3
......@@ -38,8 +38,19 @@ public:
void deserialize(nlohmann::json& json) override {
HexapodEnv::deserialize(json);
_reset_noise_scale = json["reset_noise_scale"].get<double>();
if (json.count("reset_noise_scale") != 0)
{
_reset_noise_scale = json["reset_noise_scale"].get<double>();
}
else
{
std::cout << "no reset noise found: defaulting to 0" << std::endl;
_reset_noise_scale = 0.;
}
apply_noise();
}
protected:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment