Project Alice
Loading...
Searching...
No Matches
economy.hpp File Reference
#include "container_types.hpp"
#include "dcon_generated.hpp"
#include "commands.hpp"
Include dependency graph for economy.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  economy::building_information
 
struct  economy::global_economy_state
 
struct  economy::nation_enriched_float
 
struct  economy::trade_volume_data_detailed
 
struct  economy::rgo_workers_breakdown
 
struct  economy::trade_and_tariff
 
struct  economy::trade_breakdown_item
 
struct  economy::full_construction_state
 
struct  economy::full_construction_province
 
struct  economy::construction_status
 
struct  economy::new_factory
 
struct  economy::upgraded_factory
 

Namespaces

namespace  economy
 

Enumerations

enum  economy::commodity_production_type { economy::primary , economy::derivative , economy::both }
 
enum class  economy::worker_effect : uint8_t { economy::none = 0 , economy::input , economy::output , economy::throughput }
 

Functions

std::string_view economy::province_building_type_get_name (economy::province_building_type v)
 
std::string_view economy::province_building_type_get_level_text (economy::province_building_type v)
 
template<typename T >
auto economy::desired_needs_spending (sys::state const &state, T pop_indices)
 
constexpr dcon::commodity_id economy::money (0)
 
void economy::presimulate (sys::state &state)
 
void economy::sanity_check (sys::state &state)
 
float economy::price (sys::state const &state, dcon::state_instance_id s, dcon::commodity_id c)
 
float economy::price (sys::state const &state, dcon::nation_id s, dcon::commodity_id c)
 
float economy::price (sys::state &state, dcon::commodity_id c)
 
ve::fp_vector economy::price (sys::state const &state, ve::tagged_vector< dcon::market_id > s, dcon::commodity_id c)
 
float economy::price (sys::state const &state, dcon::market_id s, dcon::commodity_id c)
 
float economy::supply (sys::state &state, dcon::market_id s, dcon::commodity_id c)
 
float economy::supply (sys::state &state, dcon::nation_id s, dcon::commodity_id c)
 
float economy::supply (sys::state &state, dcon::commodity_id c)
 
float economy::demand (sys::state &state, dcon::market_id s, dcon::commodity_id c)
 
float economy::demand (sys::state &state, dcon::nation_id s, dcon::commodity_id c)
 
float economy::demand (sys::state &state, dcon::commodity_id c)
 
float economy::consumption (sys::state &state, dcon::market_id s, dcon::commodity_id c)
 
float economy::consumption (sys::state &state, dcon::nation_id s, dcon::commodity_id c)
 
float economy::consumption (sys::state &state, dcon::commodity_id c)
 
float economy::demand_satisfaction (sys::state &state, dcon::market_id s, dcon::commodity_id c)
 
float economy::demand_satisfaction (sys::state &state, dcon::nation_id s, dcon::commodity_id c)
 
float economy::demand_satisfaction (sys::state &state, dcon::commodity_id c)
 
float economy::market_pool (sys::state &state, dcon::market_id s, dcon::commodity_id c)
 
float economy::market_pool (sys::state &state, dcon::nation_id s, dcon::commodity_id c)
 
float economy::market_pool (sys::state &state, dcon::commodity_id c)
 
float economy::export_volume (sys::state &state, dcon::market_id s, dcon::commodity_id c)
 
float economy::export_volume (sys::state &state, dcon::nation_id s, dcon::commodity_id c)
 
float economy::domestic_trade_volume (sys::state &state, dcon::nation_id s, dcon::commodity_id c)
 
trade_volume_data_detailed economy::export_volume_detailed (sys::state &state, dcon::nation_id s, dcon::commodity_id c)
 
float economy::import_volume (sys::state &state, dcon::market_id s, dcon::commodity_id c)
 
float economy::import_volume (sys::state &state, dcon::nation_id s, dcon::commodity_id c)
 
trade_volume_data_detailed economy::import_volume_detailed (sys::state &state, dcon::nation_id s, dcon::commodity_id c)
 
float economy::average_capitalists_luxury_cost (sys::state &state, dcon::nation_id s)
 
float economy::commodity_daily_production_amount (sys::state &state, dcon::commodity_id c)
 
float economy::effective_tariff_import_rate (sys::state &state, dcon::nation_id n)
 
float economy::effective_tariff_export_rate (sys::state &state, dcon::nation_id n)
 
float economy::rgo_effective_size (sys::state const &state, dcon::nation_id n, dcon::province_id p, dcon::commodity_id c)
 
float economy::rgo_total_effective_size (sys::state &state, dcon::nation_id n, dcon::province_id p)
 
float economy::rgo_total_employment (sys::state &state, dcon::nation_id n, dcon::province_id p)
 
float economy::rgo_full_production_quantity (sys::state const &state, dcon::nation_id n, dcon::province_id p, dcon::commodity_id c)
 
float economy::rgo_max_employment (sys::state &state, dcon::nation_id n, dcon::province_id p, dcon::commodity_id c)
 
float economy::rgo_total_max_employment (sys::state &state, dcon::nation_id n, dcon::province_id p)
 
float economy::subsistence_max_pseudoemployment (sys::state &state, dcon::nation_id n, dcon::province_id p)
 
float economy::factory_max_employment (sys::state const &state, dcon::factory_id f)
 
bool economy::has_factory (sys::state const &state, dcon::state_instance_id si)
 
bool economy::has_building (sys::state const &state, dcon::state_instance_id si, dcon::factory_type_id fac)
 
bool economy::is_bankrupt_debtor_to (sys::state &state, dcon::nation_id debt_holder, dcon::nation_id debtor)
 
float economy::factory_min_input_available (sys::state const &state, dcon::market_id m, dcon::factory_type_id fac_type)
 
float economy::factory_input_total_cost (sys::state const &state, dcon::market_id m, dcon::factory_type_id fac_type)
 
float economy::factory_min_e_input_available (sys::state const &state, dcon::market_id m, dcon::factory_type_id fac_type)
 
float economy::factory_e_input_total_cost (sys::state const &state, dcon::market_id m, dcon::factory_type_id fac_type)
 
float economy::factory_input_multiplier (sys::state const &state, dcon::factory_id fac, dcon::nation_id n, dcon::province_id p, dcon::state_instance_id s)
 
float economy::factory_throughput_multiplier (sys::state const &state, dcon::factory_type_id fac_type, dcon::nation_id n, dcon::province_id p, dcon::state_instance_id s)
 
float economy::factory_output_multiplier (sys::state const &state, dcon::factory_id fac, dcon::nation_id n, dcon::market_id m, dcon::province_id p)
 
float economy::factory_desired_raw_profit (dcon::factory_id fac, float spendings)
 
float economy::factory_max_production_scale (sys::state const &state, dcon::factory_id fac, float mobilization_impact, bool occupied)
 
float economy::factory_total_employment (sys::state const &state, dcon::factory_id f)
 
float economy::factory_primary_employment (sys::state const &state, dcon::factory_id f)
 
float economy::factory_secondary_employment (sys::state const &state, dcon::factory_id f)
 
int32_t economy::factory_priority (sys::state const &state, dcon::factory_id f)
 
void economy::set_factory_priority (sys::state &state, dcon::factory_id f, int32_t priority)
 
bool economy::factory_is_profitable (sys::state const &state, dcon::factory_id f)
 
bool economy::nation_is_constructing_factories (sys::state &state, dcon::nation_id n)
 
bool economy::nation_has_closed_factories (sys::state &state, dcon::nation_id n)
 
void economy::initialize (sys::state &state)
 
void economy::regenerate_unsaved_values (sys::state &state)
 
float economy::pop_min_wage_factor (sys::state &state, dcon::nation_id n)
 
float economy::farmer_min_wage (sys::state &state, dcon::market_id m, float min_wage_factor)
 
float economy::laborer_min_wage (sys::state &state, dcon::market_id m, float min_wage_factor)
 
rgo_workers_breakdown economy::rgo_relevant_population (sys::state &state, dcon::province_id p, dcon::nation_id n)
 
float economy::rgo_desired_worker_norm_profit (sys::state &state, dcon::province_id p, dcon::market_id m, dcon::nation_id n, float min_wage, float total_relevant_population)
 
float economy::rgo_expected_worker_norm_profit (sys::state &state, dcon::province_id p, dcon::market_id m, dcon::nation_id n, dcon::commodity_id c)
 
float economy::priority_multiplier (sys::state const &state, dcon::factory_type_id fac_type, dcon::nation_id n)
 
float economy::nation_factory_input_multiplier (sys::state const &state, dcon::factory_type_id fac_type, dcon::nation_id n)
 
float economy::nation_factory_output_multiplier (sys::state const &state, dcon::factory_type_id fac_type, dcon::nation_id n)
 
float economy::factory_type_output_cost (sys::state &state, dcon::nation_id n, dcon::market_id m, dcon::factory_type_id factory_type)
 
float economy::factory_type_input_cost (sys::state &state, dcon::nation_id n, dcon::market_id m, dcon::factory_type_id factory_type)
 
float economy::factory_type_build_cost (sys::state &state, dcon::nation_id n, dcon::market_id m, dcon::factory_type_id factory_type)
 
void economy::update_rgo_employment (sys::state &state)
 
void economy::update_factory_employment (sys::state &state)
 
void economy::daily_update (sys::state &state, bool presimulation, float presimulation_stage)
 
void economy::resolve_constructions (sys::state &state)
 
ve::fp_vector economy::base_artisan_profit (sys::state &state, ve::tagged_vector< dcon::market_id > markets, ve::tagged_vector< dcon::nation_id > nations, dcon::commodity_id c)
 
float economy::base_artisan_profit (sys::state &state, dcon::market_id market, dcon::commodity_id c)
 
std::vector< dcon::factory_type_id > economy::commodity_get_factory_types_as_output (sys::state const &state, dcon::commodity_id output_good)
 
float economy::stockpile_commodity_daily_increase (sys::state &state, dcon::commodity_id c, dcon::nation_id n)
 
float economy::global_market_commodity_daily_increase (sys::state &state, dcon::commodity_id c)
 
float economy::government_consumption (sys::state &state, dcon::nation_id n, dcon::commodity_id c)
 
float economy::nation_factory_consumption (sys::state &state, dcon::nation_id n, dcon::commodity_id c)
 
float economy::nation_pop_consumption (sys::state &state, dcon::nation_id n, dcon::commodity_id c)
 
float economy::nation_total_imports (sys::state &state, dcon::nation_id n)
 
float economy::pop_income (sys::state &state, dcon::pop_id p)
 
trade_and_tariff economy::explain_trade_route_commodity (sys::state &state, dcon::trade_route_id trade_route, dcon::commodity_id cid)
 
std::vector< trade_breakdown_item > economy::explain_national_tariff (sys::state &state, dcon::nation_id n, bool import_flag, bool export_flag)
 
float economy::estimate_gold_income (sys::state &state, dcon::nation_id n)
 
float economy::estimate_tariff_import_income (sys::state &state, dcon::nation_id n)
 
float economy::estimate_tariff_export_income (sys::state &state, dcon::nation_id n)
 
float economy::estimate_social_spending (sys::state &state, dcon::nation_id n)
 
float economy::estimate_pop_payouts_by_income_type (sys::state &state, dcon::nation_id n, culture::income_type in)
 
float economy::estimate_tax_income_by_strata (sys::state &state, dcon::nation_id n, culture::pop_strata ps)
 
float economy::estimate_subsidy_spending (sys::state &state, dcon::nation_id n)
 
float economy::estimate_diplomatic_balance (sys::state &state, dcon::nation_id n)
 
float economy::estimate_diplomatic_income (sys::state &state, dcon::nation_id n)
 
float economy::estimate_diplomatic_expenses (sys::state &state, dcon::nation_id n)
 
float economy::estimate_domestic_investment (sys::state &state, dcon::nation_id n)
 
float economy::estimate_land_spending (sys::state &state, dcon::nation_id n)
 
float economy::estimate_naval_spending (sys::state &state, dcon::nation_id n)
 
float economy::estimate_construction_spending_from_budget (sys::state &state, dcon::nation_id n, float current_budget)
 
float economy::estimate_construction_spending (sys::state &state, dcon::nation_id n)
 
float economy::estimate_private_construction_spendings (sys::state &state, dcon::nation_id nid)
 
float economy::estimate_war_subsidies_spending (sys::state &state, dcon::nation_id n)
 
float economy::estimate_reparations_spending (sys::state &state, dcon::nation_id n)
 
float economy::estimate_war_subsidies_income (sys::state &state, dcon::nation_id n)
 
float economy::estimate_reparations_income (sys::state &state, dcon::nation_id n)
 
float economy::estimate_overseas_penalty_spending (sys::state &state, dcon::nation_id n)
 
float economy::estimate_stockpile_filling_spending (sys::state &state, dcon::nation_id n)
 
std::vector< full_construction_state > economy::estimate_private_investment_upgrade (sys::state &state, dcon::nation_id nid)
 
std::vector< full_construction_state > economy::estimate_private_investment_construct (sys::state &state, dcon::nation_id nid, bool craved)
 
std::vector< full_construction_province > economy::estimate_private_investment_province (sys::state &state, dcon::nation_id nid)
 
float economy::estimate_war_subsidies (sys::state &state, dcon::nation_fat_id target, dcon::nation_fat_id source)
 
float economy::estimate_subject_payments_paid (sys::state &state, dcon::nation_id n)
 
float economy::estimate_subject_payments_received (sys::state &state, dcon::nation_id o)
 
float economy::estimate_daily_income (sys::state &state, dcon::nation_id n)
 
construction_status economy::province_building_construction (sys::state &state, dcon::province_id p, province_building_type t)
 
construction_status economy::factory_upgrade (sys::state &state, dcon::factory_id f)
 
bool economy::state_contains_constructed_factory (sys::state &state, dcon::state_instance_id s, dcon::factory_type_id ft)
 
bool economy::state_contains_factory (sys::state &state, dcon::state_instance_id s, dcon::factory_type_id ft)
 
int32_t economy::state_factory_count (sys::state &state, dcon::state_instance_id sid, dcon::nation_id n)
 
float economy::unit_construction_progress (sys::state &state, dcon::province_land_construction_id c)
 
float economy::unit_construction_progress (sys::state &state, dcon::province_naval_construction_id c)
 
void economy::try_add_factory_to_state (sys::state &state, dcon::state_instance_id s, dcon::factory_type_id t)
 
void economy::bound_budget_settings (sys::state &state, dcon::nation_id n)
 
int32_t economy::most_recent_price_record_index (sys::state &state)
 
int32_t economy::previous_price_record_index (sys::state &state)
 
int32_t economy::most_recent_gdp_record_index (sys::state &state)
 
int32_t economy::previous_gdp_record_index (sys::state &state)
 
float economy::gdp_adjusted (sys::state &state, dcon::nation_id n)
 
float economy::gdp_adjusted (sys::state &state, dcon::market_id n)
 
void economy::prune_factories (sys::state &state)
 
void economy::go_bankrupt (sys::state &state, dcon::nation_id n)
 
dcon::modifier_id economy::get_province_selector_modifier (sys::state &state)
 
dcon::modifier_id economy::get_province_immigrator_modifier (sys::state &state)
 
bool economy::can_take_loans (sys::state &state, dcon::nation_id n)
 
float economy::interest_payment (sys::state &state, dcon::nation_id n)
 
float economy::max_loan (sys::state &state, dcon::nation_id n)
 
float economy::estimate_investment_pool_daily_loss (sys::state &state, dcon::nation_id n)
 
command::budget_settings_data economy::budget_minimums (sys::state &state, dcon::nation_id n)
 
command::budget_settings_data economy::budget_maximums (sys::state &state, dcon::nation_id n)
 

Variables

constexpr float economy::subsistence_factor = 15.0f
 
constexpr float economy::subsistence_score_life = 30.0f
 
constexpr float economy::subsistence_score_everyday = 30.0f
 
constexpr float economy::subsistence_score_total = subsistence_score_life + subsistence_score_everyday
 
constexpr float economy::payouts_spending_multiplier = 10.f
 
constexpr float economy::secondary_employment_output_bonus = 3.f
 
constexpr float economy::production_scale_delta = 0.1f
 
constexpr float economy::factory_closed_threshold = 0.0001f
 
constexpr uint32_t economy::price_history_length = 256
 
constexpr uint32_t economy::gdp_history_length = 128
 
constexpr float economy::price_speed_mod = 0.001f
 
constexpr float economy::price_rigging = 0.015f
 
constexpr float economy::production_throughput_multiplier = 2.f
 
constexpr float economy::stockpile_to_supply = 0.1f
 
constexpr float economy::stockpile_spoilage = 0.15f
 
constexpr float economy::stockpile_expected_spending_per_commodity = 1000.f
 
constexpr float economy::merchant_cut_foreign = 0.05f
 
constexpr float economy::merchant_cut_domestic = 0.001f
 
constexpr float economy::rgo_owners_cut = 0.2f
 
constexpr float economy::factory_owners_cut = 0.5f
 
constexpr float economy::factory_sworkers_cut = 0.4f
 
constexpr float economy::factory_pworkers_cut = 0.1f
 
constexpr float economy::factory_workers_cut = factory_sworkers_cut + factory_pworkers_cut
 
constexpr float economy::aristocrats_greed = 0.5f
 
constexpr float economy::artisans_greed = 0.001f
 
constexpr float economy::primary_greed = 2.f
 
constexpr float economy::secondary_greed = 20.f