examples.macro_model.agents package

Submodules

examples.macro_model.agents.agents module

Agents from the basic macroeconomic model

class examples.macro_model.agents.agents.EconomicAgent(simulation, model, agent_number, agent_def)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

A basic economic agent

get_contracted_offers(contracted_offers)[source]

The agent get the contracted_offers

got_contract()[source]

the agent got a contract for an offer

release_demmand()[source]

Agent releases a demmand

release_offer()[source]

Agent releases an offer

step()[source]

Implemented by subclass

examples.macro_model.agents.agents_accounting module

This is the accounting module This module contains all the necessary classes to do

class examples.macro_model.agents.agents_accounting.Good(name_of_g, type_of_g, asset_category_of_g, consume_of_g, quantity_of_g, value_of_g, owner_of_g=None, producer_of_g=None)[source]

Bases: object

A Basic Class representing a good.

ASSET_CATEGORY = ['w', 'cg', 'k', 'ph', 'd', 'l', 'id', 'il', 'b', 'ib', 'gw', 'gt']
CONSUME = ['immediate', 'depreciable', 'debt', 'continuous']
TYPE = ['real', 'financial']

w - Wages cg - Consumer_Good k - Capital ph - Dividends d - Deposit l - Loan id - Interests on deposits il - Interests on loans b - Bonds ib - Interests on bonds gw - Government wages gt - Government transfers (to households)

estimated_value(a_quantity_of_g)[source]

Calculates the estimated value of a good given a quantity as input

total_value()[source]

Calculates the estimated value of a good for the existing quantity

examples.macro_model.agents.bank module

Banks from the basic macroeconomic model

class examples.macro_model.agents.bank.Bank(simulation, model, agent_number, agent_def)[source]

Bases: examples.macro_model.agents.agents.EconomicAgent

A Bank economic agent

get_cb()[source]

Get Central Bank from model

get_government()[source]

Get government from model

show_offer()[source]

A bank show offer

step()[source]

Step method for a bank

examples.macro_model.agents.central_bank module

Agents from the basic macroeconomic model

class examples.macro_model.agents.central_bank.CentralBank(simulation, model, agent_number, agent_def)[source]

Bases: examples.macro_model.agents.agents.EconomicAgent

The Central Bank economic agent

decide_monetary_policy()[source]

Central Bank decides monetary policy

get_government()[source]

Get government from model

show_offer()[source]

Central Bank Show Offer

step()[source]

Step method for the Central bank Agent

examples.macro_model.agents.firms module

Firm Agents from the basic macroeconomic model

class examples.macro_model.agents.firms.CGFirm(simulation, model, agent_number, agent_def)[source]

Bases: examples.macro_model.agents.firms.Firm

A Consumer Goods Firm

calculate_capacity_utilization()[source]

A CG Firm calculates capacity_utilization using capital productivity and the firm’s capital stock

calculate_labor_demand()[source]

A CG Firm calculates the total label demmand for production (NDct) This is calculated the using real capital stock for firm (kct) and the capital labor ratio for the specific technology (lk). NDct = kct/lk

compute_desired_output()[source]

A firm compute desired output The firm computes the inventory percentage that it can maintain and the desired output from the expected sales and inventory

step()[source]

Step for the CG agent

class examples.macro_model.agents.firms.Firm(simulation, model, agent_number, agent_def)[source]

Bases: examples.macro_model.agents.agents.EconomicAgent

A Generic Goods Firm

average_wage()[source]

A firm answers the average wage for contracted labor

calculate_contracted_labor()[source]

The firm calculates the contracted labor

decide_offered_wage()[source]

Decide the wage for the quantity of expected work that firm wants to contract

form_expectations(step, z_t_1, z_e_t_1, lmbda)[source]

The agent forms zie expectation using the following equation: z^e = z^e_{t-1} + lambda(z_{t-1} - z^e_{t-1}) where: z is the value of the voi and lambda(lmbda) is the impact of the variable of interest in the expectation.

generate_demmand()[source]

The Firm decides the labor demmand

pay_salaries()[source]

A firm pay the salaries

show_offer()[source]

A firm shows an offer of labor and a desired output

step()[source]

Step for the Firm agent

class examples.macro_model.agents.firms.KGFirm(simulation, model, agent_number, agent_def)[source]

Bases: examples.macro_model.agents.firms.Firm

A Capital Goods Firm

calculate_labor_demand()[source]

A KG Firm calculates the total label demmand for production (NDct) This is calculated the using desired output (yD_kt) and the labor productivity (mi_N) NDct = yD_kt/mi_N

compute_desired_output()[source]

A firm compute desired output The firm computes the inventory percentage that it can maintain and the desired output from the expected sales and inventory

step()[source]

Step for the KG agent

examples.macro_model.agents.government module

Agents from the basic macroeconomic model

class examples.macro_model.agents.government.Government(simulation, model, agent_number, agent_def)[source]

Bases: examples.macro_model.agents.agents.EconomicAgent

The Government economic agetn

calculate_available_resources()[source]

Government Calculates Available resources

show_offer()[source]

Government show offer

step()[source]

Step method for Government Agent

examples.macro_model.agents.household module

Household Agents from the basic macroeconomic model

class examples.macro_model.agents.household.Household(simulation, model, agent_number, agent_def)[source]

Bases: examples.macro_model.agents.agents.EconomicAgent

Household Agent

buy_goods()[source]

The HH buy goods in the goods market

calculate_income()[source]

The household calculates its income

decide_hourly_wage()[source]

The Household decides wage to offer

establish_demmand()[source]

The HH establish its demmand

formulate_price_expectations()[source]

The household formulates price expectations for consumer goods

generate_offer()[source]

The Household decides wage to offer

got_contract()[source]

The household is employed

offer_workforce()[source]

The Household offer its workforce

pay_taxes()[source]

The HH pay taxes to the government

reslease_bid()[source]

The agent now is unemployed

show_offer()[source]

Show Offer The agent show an offer in some market

step()[source]

Household Agent Step method

examples.macro_model.agents.production module

The production Functions for the Firms

@author: rivero

class examples.macro_model.agents.production.Equipment(owner, K=None, Y_L=None, Y_P=None, L_P=None, Y=None, L=None)[source]

Bases: object

The equipment used in the production function

produce(Y)[source]

Production

class examples.macro_model.agents.production.ProductionFunction(firm)[source]

Bases: object

The production function class is used by the firms to produce.

add_equipment(a_capital_good)[source]

Ad an equipment to the firm production capacity

get_contracted_labor(firm_contracted_labor)[source]

Get all contracted labor to produce

produce(goods)[source]

Produce using labor and equipment

Module contents

class examples.macro_model.agents.EconomicAgent(simulation, model, agent_number, agent_def)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

A basic economic agent

get_contracted_offers(contracted_offers)[source]

The agent get the contracted_offers

got_contract()[source]

the agent got a contract for an offer

release_demmand()[source]

Agent releases a demmand

release_offer()[source]

Agent releases an offer

step()[source]

Implemented by subclass

class examples.macro_model.agents.Household(simulation, model, agent_number, agent_def)[source]

Bases: examples.macro_model.agents.agents.EconomicAgent

Household Agent

buy_goods()[source]

The HH buy goods in the goods market

calculate_income()[source]

The household calculates its income

decide_hourly_wage()[source]

The Household decides wage to offer

establish_demmand()[source]

The HH establish its demmand

formulate_price_expectations()[source]

The household formulates price expectations for consumer goods

generate_offer()[source]

The Household decides wage to offer

got_contract()[source]

The household is employed

offer_workforce()[source]

The Household offer its workforce

pay_taxes()[source]

The HH pay taxes to the government

reslease_bid()[source]

The agent now is unemployed

show_offer()[source]

Show Offer The agent show an offer in some market

step()[source]

Household Agent Step method

class examples.macro_model.agents.Firm(simulation, model, agent_number, agent_def)[source]

Bases: examples.macro_model.agents.agents.EconomicAgent

A Generic Goods Firm

average_wage()[source]

A firm answers the average wage for contracted labor

calculate_contracted_labor()[source]

The firm calculates the contracted labor

decide_offered_wage()[source]

Decide the wage for the quantity of expected work that firm wants to contract

form_expectations(step, z_t_1, z_e_t_1, lmbda)[source]

The agent forms zie expectation using the following equation: z^e = z^e_{t-1} + lambda(z_{t-1} - z^e_{t-1}) where: z is the value of the voi and lambda(lmbda) is the impact of the variable of interest in the expectation.

generate_demmand()[source]

The Firm decides the labor demmand

pay_salaries()[source]

A firm pay the salaries

show_offer()[source]

A firm shows an offer of labor and a desired output

step()[source]

Step for the Firm agent

class examples.macro_model.agents.CGFirm(simulation, model, agent_number, agent_def)[source]

Bases: examples.macro_model.agents.firms.Firm

A Consumer Goods Firm

calculate_capacity_utilization()[source]

A CG Firm calculates capacity_utilization using capital productivity and the firm’s capital stock

calculate_labor_demand()[source]

A CG Firm calculates the total label demmand for production (NDct) This is calculated the using real capital stock for firm (kct) and the capital labor ratio for the specific technology (lk). NDct = kct/lk

compute_desired_output()[source]

A firm compute desired output The firm computes the inventory percentage that it can maintain and the desired output from the expected sales and inventory

step()[source]

Step for the CG agent

class examples.macro_model.agents.KGFirm(simulation, model, agent_number, agent_def)[source]

Bases: examples.macro_model.agents.firms.Firm

A Capital Goods Firm

calculate_labor_demand()[source]

A KG Firm calculates the total label demmand for production (NDct) This is calculated the using desired output (yD_kt) and the labor productivity (mi_N) NDct = yD_kt/mi_N

compute_desired_output()[source]

A firm compute desired output The firm computes the inventory percentage that it can maintain and the desired output from the expected sales and inventory

step()[source]

Step for the KG agent

class examples.macro_model.agents.Bank(simulation, model, agent_number, agent_def)[source]

Bases: examples.macro_model.agents.agents.EconomicAgent

A Bank economic agent

get_cb()[source]

Get Central Bank from model

get_government()[source]

Get government from model

show_offer()[source]

A bank show offer

step()[source]

Step method for a bank

class examples.macro_model.agents.CentralBank(simulation, model, agent_number, agent_def)[source]

Bases: examples.macro_model.agents.agents.EconomicAgent

The Central Bank economic agent

decide_monetary_policy()[source]

Central Bank decides monetary policy

get_government()[source]

Get government from model

show_offer()[source]

Central Bank Show Offer

step()[source]

Step method for the Central bank Agent

class examples.macro_model.agents.Government(simulation, model, agent_number, agent_def)[source]

Bases: examples.macro_model.agents.agents.EconomicAgent

The Government economic agetn

calculate_available_resources()[source]

Government Calculates Available resources

show_offer()[source]

Government show offer

step()[source]

Step method for Government Agent

class examples.macro_model.agents.Good(name_of_g, type_of_g, asset_category_of_g, consume_of_g, quantity_of_g, value_of_g, owner_of_g=None, producer_of_g=None)[source]

Bases: object

A Basic Class representing a good.

ASSET_CATEGORY = ['w', 'cg', 'k', 'ph', 'd', 'l', 'id', 'il', 'b', 'ib', 'gw', 'gt']
CONSUME = ['immediate', 'depreciable', 'debt', 'continuous']
TYPE = ['real', 'financial']

w - Wages cg - Consumer_Good k - Capital ph - Dividends d - Deposit l - Loan id - Interests on deposits il - Interests on loans b - Bonds ib - Interests on bonds gw - Government wages gt - Government transfers (to households)

estimated_value(a_quantity_of_g)[source]

Calculates the estimated value of a good given a quantity as input

total_value()[source]

Calculates the estimated value of a good for the existing quantity