Skip to content

Conversation

@Spartan322
Copy link
Member

@Spartan322 Spartan322 commented Dec 5, 2025

Move pop_size_t to population/PopSize.hpp
Add equalable to Concepts.hpp
Add expect_strong_typedef to NodeTools.hpp
Add && equalable<ValueType, OtherValueType> requirement to IndexedFlatMap's divide_assign_handle_zero
Fix ovdl::detail vs. OpenVic::detail namespace ambiguity in Dataloader.cpp

@Spartan322 Spartan322 force-pushed the refactor/pop-size-type branch 3 times, most recently from cdaa3ff to 9fddcce Compare December 5, 2025 20:39
@Spartan322 Spartan322 force-pushed the refactor/pop-size-type branch from 9fddcce to f8b5c23 Compare December 6, 2025 06:25
@Spartan322 Spartan322 force-pushed the refactor/pop-size-type branch from f8b5c23 to 3bdc2d4 Compare December 30, 2025 11:39
@Spartan322 Spartan322 changed the title Refactor pop_size_t to be type-safe Add type-safe pop_sum_t for large value sums of pops Dec 30, 2025
@Spartan322 Spartan322 changed the title Add type-safe pop_sum_t for large value sums of pops Add type-safe pop_sum_t for large value sums of pops, refactor pop_size_t to be type-safe Dec 30, 2025
@Spartan322 Spartan322 changed the title Add type-safe pop_sum_t for large value sums of pops, refactor pop_size_t to be type-safe Add type-safe pop_sum_t for large value sums of pops and refactor pop_size_t to be type-safe Dec 30, 2025
@Spartan322 Spartan322 marked this pull request as ready for review December 30, 2025 11:41
@Spartan322 Spartan322 force-pushed the refactor/pop-size-type branch 2 times, most recently from 752014c to 7857b24 Compare December 30, 2025 12:03
Refactor pop_size_t to be type-safe

Move pop_size_t to population/PopSize.hpp
Add equalable to Concepts.hpp
Add expect_strong_typedef to NodeTools.hpp
Add `&& equalable<ValueType, OtherValueType>` requirement to IndexedFlatMap's divide_assign_handle_zero
Fix ovdl::detail vs. OpenVic::detail namespace ambiguity in Dataloader.cpp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems unrelated

struct ProductionType;
struct ProvinceInstance;
struct RandomU32;
struct pop_size_t;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still need this?

"type", ZERO_OR_ONE,
expect_identifier(expect_mapped_string(template_type_map, assign_variable_callback(template_type))),
"workforce", ZERO_OR_ONE, expect_uint(assign_variable_callback(base_workforce_size)),
"workforce", ZERO_OR_ONE, expect_strong_typedef<pop_size_t>(assign_variable_callback(base_workforce_size)),
Copy link
Contributor

@wvpm wvpm Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you use pop_size_t here for Vic2 restrictions?
If so, we should use pop_size_t for base_workforce_size as well
If not, use pop_sum_t


const fixed_point_t size_modifier = calculate_size_modifier();
const fixed_point_t base_workforce_size = production_type.base_workforce_size;
const fixed_point_t base_workforce_size = type_safe::get(production_type.base_workforce_size);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If base_workforce_size is uint64, it won't fit in a fixed_point_t.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants