Project Alice
Loading...
Searching...
No Matches
demographics.cpp File Reference
#include "demographics.hpp"
#include "dcon_generated.hpp"
#include "system_state.hpp"
#include "prng.hpp"
#include "province_templates.hpp"
#include "nations.hpp"
#include "nations_templates.hpp"
#include "triggers.hpp"
#include "ve_scalar_extensions.hpp"
#include "container_types.hpp"
Include dependency graph for demographics.cpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  pop_demographics
 
namespace  demographics
 
namespace  demographics::impl
 

Functions

dcon::pop_demographics_key pop_demographics::to_key (sys::state const &state, dcon::ideology_id v)
 
dcon::pop_demographics_key pop_demographics::to_key (sys::state const &state, dcon::issue_option_id v)
 
uint32_t pop_demographics::size (sys::state const &state)
 
void pop_demographics::regenerate_is_primary_or_accepted (sys::state &state)
 
float pop_demographics::get_demo (sys::state const &state, dcon::pop_id p, dcon::pop_demographics_key k)
 
void pop_demographics::set_demo (sys::state &state, dcon::pop_id p, dcon::pop_demographics_key k, float v)
 
template<typename T >
void pop_demographics::set_demo (sys::state &state, T p, dcon::pop_demographics_key k, ve::fp_vector v)
 
float pop_demographics::get_militancy (sys::state const &state, dcon::pop_id p)
 
void pop_demographics::set_militancy (sys::state &state, dcon::pop_id p, float v)
 
template<typename T >
void pop_demographics::set_militancy (sys::state &state, T p, ve::fp_vector v)
 
float pop_demographics::get_consciousness (sys::state const &state, dcon::pop_id p)
 
void pop_demographics::set_consciousness (sys::state &state, dcon::pop_id p, float v)
 
template<typename T >
void pop_demographics::set_consciousness (sys::state &state, T p, ve::fp_vector v)
 
float pop_demographics::get_literacy (sys::state const &state, dcon::pop_id p)
 
template<typename T >
void pop_demographics::set_literacy (sys::state &state, T p, ve::fp_vector v)
 
void pop_demographics::set_literacy (sys::state &state, dcon::pop_id p, float v)
 
float pop_demographics::get_employment (sys::state const &state, dcon::pop_id p)
 
float pop_demographics::get_raw_employment (sys::state const &state, dcon::pop_id p)
 
void pop_demographics::set_employment (sys::state &state, dcon::pop_id p, float v)
 
void pop_demographics::set_raw_employment (sys::state &state, dcon::pop_id p, float v)
 
float pop_demographics::get_life_needs (sys::state const &state, dcon::pop_id p)
 
void pop_demographics::set_life_needs (sys::state &state, dcon::pop_id p, float v)
 
float pop_demographics::get_everyday_needs (sys::state const &state, dcon::pop_id p)
 
void pop_demographics::set_everyday_needs (sys::state &state, dcon::pop_id p, float v)
 
float pop_demographics::get_luxury_needs (sys::state const &state, dcon::pop_id p)
 
void pop_demographics::set_luxury_needs (sys::state &state, dcon::pop_id p, float v)
 
float pop_demographics::get_social_reform_desire (sys::state const &state, dcon::pop_id p)
 
void pop_demographics::set_social_reform_desire (sys::state &state, dcon::pop_id p, float v)
 
float pop_demographics::get_political_reform_desire (sys::state const &state, dcon::pop_id p)
 
void pop_demographics::set_political_reform_desire (sys::state &state, dcon::pop_id p, float v)
 
dcon::demographics_key demographics::to_key (sys::state const &state, dcon::pop_type_id v)
 
dcon::demographics_key demographics::to_employment_key (sys::state const &state, dcon::pop_type_id v)
 
dcon::demographics_key demographics::to_key (sys::state const &state, dcon::culture_id v)
 
dcon::demographics_key demographics::to_key (sys::state const &state, dcon::ideology_id v)
 
dcon::demographics_key demographics::to_key (sys::state const &state, dcon::issue_option_id v)
 
dcon::demographics_key demographics::to_key (sys::state const &state, dcon::religion_id v)
 
uint32_t demographics::size (sys::state const &state)
 
uint32_t demographics::common_size (sys::state const &state)
 
template<typename F >
void demographics::sum_over_demographics (sys::state &state, dcon::demographics_key key, F const &source)
 
template<typename F >
void demographics::alt_sum_over_demographics (sys::state &state, dcon::demographics_key key, F const &source)
 
void demographics::alt_copy_demographics (sys::state &state, dcon::demographics_key key)
 
template<typename F >
void demographics::sum_over_single_nation_demographics (sys::state &state, dcon::demographics_key key, dcon::nation_id n, F const &source)
 
void demographics::regenerate_jingoism_support (sys::state &state, dcon::nation_id n)
 
template<bool full>
void demographics::regenerate_from_pop_data (sys::state &state)
 
void demographics::regenerate_from_pop_data_full (sys::state &state)
 
void demographics::regenerate_from_pop_data_daily (sys::state &state)
 
template<bool full>
void demographics::alt_mt_regenerate_from_pop_data (sys::state &state)
 
template<bool full>
void demographics::alt_st_regenerate_from_pop_data (sys::state &state)
 
void demographics::alt_regenerate_from_pop_data_daily (sys::state &state)
 
void demographics::alt_regenerate_from_pop_data_full (sys::state &state)
 
void demographics::alt_demographics_update_extras (sys::state &state)
 
template<typename F >
void demographics::execute_staggered_blocks (uint32_t offset, uint32_t divisions, uint32_t max, F &&functor)
 
template<typename F >
void demographics::pexecute_staggered_blocks (uint32_t offset, uint32_t divisions, uint32_t max, F &&functor)
 
void demographics::update_militancy (sys::state &state, uint32_t offset, uint32_t divisions)
 
float demographics::get_estimated_mil_change (sys::state &state, dcon::pop_id ids)
 
float demographics::get_estimated_mil_change (sys::state &state, dcon::nation_id n)
 
void demographics::update_consciousness (sys::state &state, uint32_t offset, uint32_t divisions)
 
float demographics::get_estimated_con_change (sys::state &state, dcon::pop_id ids)
 
float demographics::get_estimated_con_change (sys::state &state, dcon::nation_id n)
 
void demographics::update_literacy (sys::state &state, uint32_t offset, uint32_t divisions)
 
float demographics::get_estimated_literacy_change (sys::state &state, dcon::pop_id ids)
 
float demographics::get_estimated_literacy_change (sys::state &state, dcon::nation_id n)
 
void demographics::update_ideologies (sys::state &state, uint32_t offset, uint32_t divisions, ideology_buffer &ibuf)
 
void demographics::apply_ideologies (sys::state &state, uint32_t offset, uint32_t divisions, ideology_buffer &pbuf)
 
void demographics::update_issues (sys::state &state, uint32_t offset, uint32_t divisions, issues_buffer &ibuf)
 
void demographics::apply_issues (sys::state &state, uint32_t offset, uint32_t divisions, issues_buffer &pbuf)
 
void demographics::update_growth (sys::state &state, uint32_t offset, uint32_t divisions)
 
float demographics::get_monthly_pop_increase (sys::state &state, dcon::pop_id ids)
 
int64_t demographics::get_monthly_pop_increase (sys::state &state, dcon::nation_id n)
 
int64_t demographics::get_monthly_pop_increase (sys::state &state, dcon::state_instance_id n)
 
int64_t demographics::get_monthly_pop_increase (sys::state &state, dcon::province_id n)
 
void demographics::update_type_changes (sys::state &state, uint32_t offset, uint32_t divisions, promotion_buffer &pbuf)
 
float demographics::get_effective_estimation_type_change (sys::state &state, dcon::nation_id nation, dcon::pop_type_id target_type)
 
float demographics::get_estimated_type_change (sys::state &state, dcon::pop_id ids)
 
float demographics::get_estimated_promotion (sys::state &state, dcon::pop_id ids)
 
float demographics::get_estimated_demotion (sys::state &state, dcon::pop_id ids)
 
void demographics::update_assimilation (sys::state &state, uint32_t offset, uint32_t divisions, assimilation_buffer &pbuf)
 
float demographics::get_estimated_assimilation (sys::state &state, dcon::pop_id ids)
 
dcon::province_id demographics::impl::get_province_target_in_nation (sys::state &state, dcon::nation_id n, dcon::pop_id p)
 
dcon::province_id demographics::impl::get_colonial_province_target_in_nation (sys::state &state, dcon::nation_id n, dcon::pop_id p)
 
dcon::nation_id demographics::impl::get_immigration_target (sys::state &state, dcon::nation_id owner, dcon::pop_id p, sys::date day)
 
void demographics::update_internal_migration (sys::state &state, uint32_t offset, uint32_t divisions, migration_buffer &pbuf)
 
float demographics::get_estimated_internal_migration (sys::state &state, dcon::pop_id ids)
 
void demographics::update_colonial_migration (sys::state &state, uint32_t offset, uint32_t divisions, migration_buffer &pbuf)
 
float demographics::get_estimated_colonial_migration (sys::state &state, dcon::pop_id ids)
 
void demographics::update_immigration (sys::state &state, uint32_t offset, uint32_t divisions, migration_buffer &pbuf)
 
void demographics::estimate_directed_immigration (sys::state &state, dcon::nation_id n, std::vector< float > &national_amounts)
 
float demographics::get_estimated_emigration (sys::state &state, dcon::pop_id ids)
 
dcon::pop_id demographics::impl::find_or_make_pop (sys::state &state, dcon::province_id loc, dcon::culture_id cid, dcon::religion_id rid, dcon::pop_type_id ptid, float l)
 
void demographics::apply_type_changes (sys::state &state, uint32_t offset, uint32_t divisions, promotion_buffer &pbuf)
 
void demographics::apply_assimilation (sys::state &state, uint32_t offset, uint32_t divisions, assimilation_buffer &pbuf)
 
void demographics::apply_internal_migration (sys::state &state, uint32_t offset, uint32_t divisions, migration_buffer &pbuf)
 
void demographics::apply_colonial_migration (sys::state &state, uint32_t offset, uint32_t divisions, migration_buffer &pbuf)
 
void demographics::apply_immigration (sys::state &state, uint32_t offset, uint32_t divisions, migration_buffer &pbuf)
 
void demographics::remove_size_zero_pops (sys::state &state)
 
void demographics::remove_small_pops (sys::state &state)
 
float demographics::calculate_nation_sol (sys::state &state, dcon::nation_id nation_id)
 
void demographics::reduce_pop_size_safe (sys::state &state, dcon::pop_id pop_id, int32_t amount)
 

Variables

constexpr float demographics::small_pop_size = 100.0f
 
constexpr uint32_t demographics::extra_demo_grouping = 8
 
constexpr uint32_t demographics::executions_per_block = 16 / ve::vector_size
 
constexpr float demographics::issues_change_rate = 0.20f