Skip to content

Commit

Permalink
Cast IDs to uint64_t in agent, consumable_resource, reusable_resource…
Browse files Browse the repository at this point in the history
…, and state_variable classes for consistency
  • Loading branch information
riccardodebenedictis committed Nov 11, 2024
1 parent 9a0e4e2 commit e313c88
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion extern/semitone
Submodule semitone updated 1 files
+2 −2 src/ov/ov_theory.cpp
2 changes: 1 addition & 1 deletion src/types/agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace ratio

for (const auto &[agnt, atms] : agnt_instances)
{
json::json tl{{"id", get_id(*agnt)}, {"type", AGENT_TYPE_NAME}};
json::json tl{{"id", static_cast<uint64_t>(get_id(*agnt))}, {"type", AGENT_TYPE_NAME}};
#ifdef COMPUTE_NAMES
tl["name"] = get_solver().guess_name(*agnt);
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/types/consumable_resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ namespace ratio
for (const auto &[cres, atms] : cr_instances)
{
const auto c_initial_amount = get_solver().arithmetic_value(*std::static_pointer_cast<riddle::arith_item>(cres->get(CONSUMABLE_RESOURCE_INITIAL_AMOUNT_NAME)));
json::json tl{{"id", get_id(*cres)}, {"type", CONSUMABLE_RESOURCE_TYPE_NAME}, {CONSUMABLE_RESOURCE_CAPACITY_NAME, to_json(get_solver().arithmetic_value(*std::static_pointer_cast<riddle::arith_item>(cres->get(CONSUMABLE_RESOURCE_CAPACITY_NAME))))}, {CONSUMABLE_RESOURCE_INITIAL_AMOUNT_NAME, to_json(c_initial_amount)}};
json::json tl{{"id", static_cast<uint64_t>(get_id(*cres))}, {"type", CONSUMABLE_RESOURCE_TYPE_NAME}, {CONSUMABLE_RESOURCE_CAPACITY_NAME, to_json(get_solver().arithmetic_value(*std::static_pointer_cast<riddle::arith_item>(cres->get(CONSUMABLE_RESOURCE_CAPACITY_NAME))))}, {CONSUMABLE_RESOURCE_INITIAL_AMOUNT_NAME, to_json(c_initial_amount)}};
#ifdef COMPUTE_NAMES
tl["name"] = get_solver().guess_name(*cres);
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/types/reusable_resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ namespace ratio

for (const auto &[rr, atms] : rr_instances)
{
json::json tl{{"id", get_id(*rr)}, {"type", REUSABLE_RESOURCE_TYPE_NAME}};
json::json tl{{"id", static_cast<uint64_t>(get_id(*rr))}, {"type", REUSABLE_RESOURCE_TYPE_NAME}};
#ifdef COMPUTE_NAMES
tl["name"] = get_solver().guess_name(*rr);
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/types/state_variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ namespace ratio

for (const auto &[sv, atms] : sv_instances)
{
json::json tl{{"id", get_id(*sv)}, {"type", STATE_VARIABLE_TYPE_NAME}};
json::json tl{{"id", static_cast<uint64_t>(get_id(*sv))}, {"type", STATE_VARIABLE_TYPE_NAME}};
#ifdef COMPUTE_NAMES
tl["name"] = get_solver().guess_name(*sv);
#endif
Expand Down

0 comments on commit e313c88

Please sign in to comment.