2#include "dcon_generated.hpp"
9dcon::pop_demographics_key
to_key(
sys::state const& state, dcon::ideology_id v);
10dcon::pop_demographics_key
to_key(
sys::state const& state, dcon::issue_option_id v);
13constexpr inline float pop_mc_scaling = 10.0f / float(std::numeric_limits<uint16_t>::max());
14constexpr inline float pop_u16_scaling = 1.0f / float(std::numeric_limits<uint16_t>::max());
15constexpr inline float pop_u8_scaling = 1.0f / float(std::numeric_limits<uint8_t>::max());
29inline ve::int_vector
to_pu8(ve::fp_vector v) {
32inline ve::int_vector
to_pu16(ve::fp_vector v) {
35inline ve::int_vector
to_pmc(ve::fp_vector v) {
49inline ve::fp_vector
from_pu8(ve::int_vector v) {
55inline ve::fp_vector
from_pmc(ve::int_vector v) {
61void set_demo(
sys::state& state, dcon::pop_id p, dcon::pop_demographics_key k,
float v);
85 auto ival = state.world.pop_get_uemployment(p);
86 return from_pu8(ival) * state.world.pop_get_size(p);
90 auto ival = state.world.pop_get_uemployment(p);
95 auto ival = state.world.pop_get_usocial_reform_desire(p);
100 auto ival = state.world.pop_get_upolitical_reform_desire(p);
105 auto ival = state.world.pop_get_umilitancy(p);
110 auto ival = state.world.pop_get_uconsciousness(p);
115 auto ival = state.world.pop_get_uliteracy(p);
120 auto ival = state.world.pop_get_ulife_needs_satisfaction(p);
125 auto ival = state.world.pop_get_ueveryday_needs_satisfaction(p);
130 auto ival = state.world.pop_get_uluxury_needs_satisfaction(p);
135 auto ival = state.world.pop_get_udemographics(p, k);
142constexpr inline dcon::demographics_key
total(0);
144constexpr inline dcon::demographics_key
employed(2);
147constexpr inline dcon::demographics_key
literacy(5);
169dcon::demographics_key
to_key(
sys::state const& state, dcon::issue_option_id v);
190 for(
uint32_t i = 0; i < state.world.ideology_size(); ++i) {
198 state.world.for_each_ideology(
199 [&](dcon::ideology_id i) {
temp_buffers[i] = ve::vectorizable_buffer<uint8_t, dcon::pop_id>(s); });
209 for(
uint32_t i = 0; i < state.world.issue_option_size(); ++i) {
217 state.world.for_each_issue_option(
218 [&](dcon::issue_option_id i) {
temp_buffers[i] = ve::vectorizable_buffer<uint8_t, dcon::pop_id>(s); });
224 ve::vectorizable_buffer<float, dcon::pop_id>
amounts;
225 ve::vectorizable_buffer<dcon::pop_type_id, dcon::pop_id>
types;
234 amounts = ve::vectorizable_buffer<float, dcon::pop_id>(s);
235 types = ve::vectorizable_buffer<dcon::pop_type_id, dcon::pop_id>(s);
241 ve::vectorizable_buffer<float, dcon::pop_id>
amounts;
250 amounts = ve::vectorizable_buffer<float, dcon::pop_id>(s);
256 ve::vectorizable_buffer<float, dcon::pop_id>
amounts;
266 amounts = ve::vectorizable_buffer<float, dcon::pop_id>(s);
267 destinations = ve::vectorizable_buffer<dcon::province_id, dcon::pop_id>(s);
tag_type emplace_back(T &&... ts)
float get_effective_estimation_type_change(sys::state &state, dcon::nation_id nation, dcon::pop_type_id target_type)
constexpr dcon::demographics_key rich_life_needs(13)
constexpr dcon::demographics_key poor_luxury_needs(17)
constexpr dcon::demographics_key middle_life_needs(12)
float get_estimated_colonial_migration(sys::state &state, dcon::pop_id ids)
void estimate_directed_immigration(sys::state &state, dcon::nation_id n, std::vector< float > &national_amounts)
constexpr dcon::demographics_key rich_militancy(10)
void alt_demographics_update_extras(sys::state &state)
float get_estimated_literacy_change(sys::state &state, dcon::pop_id ids)
constexpr dcon::demographics_key middle_total(21)
constexpr dcon::demographics_key middle_luxury_needs(18)
float get_estimated_type_change(sys::state &state, dcon::pop_id ids)
constexpr dcon::demographics_key political_reform_desire(6)
float calculate_nation_sol(sys::state &state, dcon::nation_id nation_id)
void remove_small_pops(sys::state &state)
void regenerate_jingoism_support(sys::state &state, dcon::nation_id n)
void update_immigration(sys::state &state, uint32_t offset, uint32_t divisions, migration_buffer &pbuf)
constexpr dcon::demographics_key total(0)
constexpr dcon::demographics_key rich_everyday_needs(16)
constexpr dcon::demographics_key poor_militancy(8)
constexpr dcon::demographics_key rich_luxury_needs(19)
void apply_assimilation(sys::state &state, uint32_t offset, uint32_t divisions, assimilation_buffer &pbuf)
constexpr dcon::demographics_key poor_everyday_needs(14)
constexpr dcon::demographics_key middle_militancy(9)
void update_internal_migration(sys::state &state, uint32_t offset, uint32_t divisions, migration_buffer &pbuf)
void apply_type_changes(sys::state &state, uint32_t offset, uint32_t divisions, promotion_buffer &pbuf)
dcon::demographics_key to_key(sys::state const &state, dcon::pop_type_id v)
float get_estimated_mil_change(sys::state &state, dcon::pop_id ids)
constexpr uint32_t count_special_keys
constexpr dcon::demographics_key employable(1)
void update_growth(sys::state &state, uint32_t offset, uint32_t divisions)
void alt_regenerate_from_pop_data_daily(sys::state &state)
constexpr dcon::demographics_key consciousness(3)
void update_issues(sys::state &state, uint32_t offset, uint32_t divisions, issues_buffer &ibuf)
void apply_internal_migration(sys::state &state, uint32_t offset, uint32_t divisions, migration_buffer &pbuf)
constexpr dcon::demographics_key rich_total(22)
constexpr dcon::demographics_key poor_total(20)
void update_type_changes(sys::state &state, uint32_t offset, uint32_t divisions, promotion_buffer &pbuf)
void regenerate_from_pop_data_full(sys::state &state)
void reduce_pop_size_safe(sys::state &state, dcon::pop_id pop_id, int32_t amount)
float get_estimated_internal_migration(sys::state &state, dcon::pop_id ids)
float get_estimated_demotion(sys::state &state, dcon::pop_id ids)
constexpr dcon::demographics_key poor_life_needs(11)
constexpr dcon::demographics_key employed(2)
uint32_t size(sys::state const &state)
float get_monthly_pop_increase(sys::state &state, dcon::pop_id ids)
float get_estimated_con_change(sys::state &state, dcon::pop_id ids)
dcon::demographics_key to_employment_key(sys::state const &state, dcon::pop_type_id v)
constexpr dcon::demographics_key social_reform_desire(7)
void update_assimilation(sys::state &state, uint32_t offset, uint32_t divisions, assimilation_buffer &pbuf)
void alt_regenerate_from_pop_data_full(sys::state &state)
void remove_size_zero_pops(sys::state &state)
constexpr dcon::demographics_key literacy(5)
void update_colonial_migration(sys::state &state, uint32_t offset, uint32_t divisions, migration_buffer &pbuf)
void apply_ideologies(sys::state &state, uint32_t offset, uint32_t divisions, ideology_buffer &pbuf)
void update_ideologies(sys::state &state, uint32_t offset, uint32_t divisions, ideology_buffer &ibuf)
void update_consciousness(sys::state &state, uint32_t offset, uint32_t divisions)
constexpr dcon::demographics_key middle_everyday_needs(15)
float get_estimated_assimilation(sys::state &state, dcon::pop_id ids)
void update_literacy(sys::state &state, uint32_t offset, uint32_t divisions)
void update_militancy(sys::state &state, uint32_t offset, uint32_t divisions)
void apply_colonial_migration(sys::state &state, uint32_t offset, uint32_t divisions, migration_buffer &pbuf)
float get_estimated_emigration(sys::state &state, dcon::pop_id ids)
void regenerate_from_pop_data_daily(sys::state &state)
constexpr dcon::demographics_key militancy(4)
void apply_immigration(sys::state &state, uint32_t offset, uint32_t divisions, migration_buffer &pbuf)
float get_estimated_promotion(sys::state &state, dcon::pop_id ids)
void apply_issues(sys::state &state, uint32_t offset, uint32_t divisions, issues_buffer &pbuf)
constexpr float inv_pop_u8_scaling
constexpr float pop_u16_scaling
void set_political_reform_desire(sys::state &state, dcon::pop_id p, float v)
void set_militancy(sys::state &state, dcon::pop_id p, float v)
float from_pmc(uint16_t v)
void set_social_reform_desire(sys::state &state, dcon::pop_id p, float v)
uint32_t size(sys::state const &state)
float get_employment(sys::state const &state, dcon::pop_id p)
void set_employment(sys::state &state, dcon::pop_id p, float v)
float get_social_reform_desire(sys::state const &state, dcon::pop_id p)
float get_luxury_needs(sys::state const &state, dcon::pop_id p)
void set_raw_employment(sys::state &state, dcon::pop_id p, float v)
void set_luxury_needs(sys::state &state, dcon::pop_id p, float v)
void regenerate_is_primary_or_accepted(sys::state &state)
constexpr float inv_pop_mc_scaling
void set_demo(sys::state &state, dcon::pop_id p, dcon::pop_demographics_key k, float v)
uint16_t to_pu16(float v)
float from_pu8(uint8_t v)
void set_consciousness(sys::state &state, dcon::pop_id p, float v)
void set_everyday_needs(sys::state &state, dcon::pop_id p, float v)
dcon::pop_demographics_key to_key(sys::state const &state, dcon::ideology_id v)
float get_literacy(sys::state const &state, dcon::pop_id p)
float get_consciousness(sys::state const &state, dcon::pop_id p)
float get_militancy(sys::state const &state, dcon::pop_id p)
constexpr float inv_pop_u16_scaling
float get_raw_employment(sys::state const &state, dcon::pop_id p)
float get_life_needs(sys::state const &state, dcon::pop_id p)
float get_political_reform_desire(sys::state const &state, dcon::pop_id p)
void set_literacy(sys::state &state, T p, ve::fp_vector v)
constexpr float pop_u8_scaling
constexpr float pop_mc_scaling
void set_life_needs(sys::state &state, dcon::pop_id p, float v)
float get_everyday_needs(sys::state const &state, dcon::pop_id p)
float from_pu16(uint16_t v)
constexpr uint32_t count_special_keys
float get_demo(sys::state const &state, dcon::pop_id p, dcon::pop_demographics_key k)
int32_t to_int(int32_t a)
float to_float(int32_t a)
ve::vectorizable_buffer< float, dcon::pop_id > amounts
tagged_vector< ve::vectorizable_buffer< uint8_t, dcon::pop_id >, dcon::ideology_id > temp_buffers
ideology_buffer(sys::state &state)
void update(sys::state &state, uint32_t s)
void update(sys::state &state, uint32_t s)
tagged_vector< ve::vectorizable_buffer< uint8_t, dcon::pop_id >, dcon::issue_option_id > temp_buffers
issues_buffer(sys::state &state)
ve::vectorizable_buffer< dcon::province_id, dcon::pop_id > destinations
ve::vectorizable_buffer< float, dcon::pop_id > amounts