Skip to content

Commit

Permalink
double for param value
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Dec 12, 2024
1 parent c884e8f commit 4d7767f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/solver/systemParser/encoders.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct convert<Antares::Solver::SystemParser::Parameter>
}
rhs.id = node["id"].as<std::string>();
rhs.type = node["type"].as<std::string>();
rhs.value = node["value"].as<std::string>();
rhs.value = node["value"].as<double>();
return true;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct Parameter
{
std::string id;
std::string type;
std::string value;
double value;
};

struct Component
Expand Down
6 changes: 3 additions & 3 deletions src/tests/src/solver/modelParser/testSystemParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ BOOST_AUTO_TEST_CASE(component_parameter)
const auto& param = systemObj.components[0].parameters[0];
BOOST_CHECK_EQUAL(param.id, "cost");
BOOST_CHECK_EQUAL(param.type, "constant");
BOOST_CHECK_EQUAL(param.value, "30");
BOOST_CHECK_EQUAL(param.value, 30);
}

BOOST_AUTO_TEST_CASE(component_two_parameters)
Expand All @@ -175,8 +175,8 @@ BOOST_AUTO_TEST_CASE(component_two_parameters)
const auto& param2 = systemObj.components[0].parameters[1];
BOOST_CHECK_EQUAL(param.id, "cost");
BOOST_CHECK_EQUAL(param.type, "constant");
BOOST_CHECK_EQUAL(param.value, "30");
BOOST_CHECK_EQUAL(param.value, 30);
BOOST_CHECK_EQUAL(param2.id, "p_max");
BOOST_CHECK_EQUAL(param2.type, "constant");
BOOST_CHECK_EQUAL(param2.value, "100");
BOOST_CHECK_EQUAL(param2.value, 100);
}

0 comments on commit 4d7767f

Please sign in to comment.