From e313c885becfb982f3e8a3c5edd1b4ee7650fa84 Mon Sep 17 00:00:00 2001 From: Riccardo De Benedictis Date: Mon, 11 Nov 2024 14:38:06 +0100 Subject: [PATCH] Cast IDs to uint64_t in agent, consumable_resource, reusable_resource, and state_variable classes for consistency --- extern/semitone | 2 +- src/types/agent.cpp | 2 +- src/types/consumable_resource.cpp | 2 +- src/types/reusable_resource.cpp | 2 +- src/types/state_variable.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extern/semitone b/extern/semitone index be2e3f9..ba8eabd 160000 --- a/extern/semitone +++ b/extern/semitone @@ -1 +1 @@ -Subproject commit be2e3f9fc1344a9d9ab2de4416bc7e800a4dfb8b +Subproject commit ba8eabd3eaf9b9adccc7493d615ec31512ec0de4 diff --git a/src/types/agent.cpp b/src/types/agent.cpp index 39cbf6d..40f5413 100644 --- a/src/types/agent.cpp +++ b/src/types/agent.cpp @@ -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(get_id(*agnt))}, {"type", AGENT_TYPE_NAME}}; #ifdef COMPUTE_NAMES tl["name"] = get_solver().guess_name(*agnt); #endif diff --git a/src/types/consumable_resource.cpp b/src/types/consumable_resource.cpp index bd33461..ad859f4 100644 --- a/src/types/consumable_resource.cpp +++ b/src/types/consumable_resource.cpp @@ -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(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(cres->get(CONSUMABLE_RESOURCE_CAPACITY_NAME))))}, {CONSUMABLE_RESOURCE_INITIAL_AMOUNT_NAME, to_json(c_initial_amount)}}; + json::json tl{{"id", static_cast(get_id(*cres))}, {"type", CONSUMABLE_RESOURCE_TYPE_NAME}, {CONSUMABLE_RESOURCE_CAPACITY_NAME, to_json(get_solver().arithmetic_value(*std::static_pointer_cast(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 diff --git a/src/types/reusable_resource.cpp b/src/types/reusable_resource.cpp index f82abf9..b57ade6 100644 --- a/src/types/reusable_resource.cpp +++ b/src/types/reusable_resource.cpp @@ -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(get_id(*rr))}, {"type", REUSABLE_RESOURCE_TYPE_NAME}}; #ifdef COMPUTE_NAMES tl["name"] = get_solver().guess_name(*rr); #endif diff --git a/src/types/state_variable.cpp b/src/types/state_variable.cpp index 28a2731..4fdc9b3 100644 --- a/src/types/state_variable.cpp +++ b/src/types/state_variable.cpp @@ -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(get_id(*sv))}, {"type", STATE_VARIABLE_TYPE_NAME}}; #ifdef COMPUTE_NAMES tl["name"] = get_solver().guess_name(*sv); #endif