agentsociety.cityagent.firmagent

Module Contents

Classes

FirmAgentConfig

Configuration for FirmAgent.

FirmAgent

Agent representing a firm in an economic simulation.

Data

API

agentsociety.cityagent.firmagent.__all__

[‘FirmAgent’]

class agentsociety.cityagent.firmagent.FirmAgentConfig

Bases: agentsociety.agent.AgentParams

Configuration for FirmAgent.

time_diff: int

‘Field(…)’

max_price_inflation: float

‘Field(…)’

max_wage_inflation: float

‘Field(…)’

class agentsociety.cityagent.firmagent.FirmAgent(id: int, name: str, toolbox: agentsociety.agent.AgentToolbox, memory: agentsociety.memory.Memory, agent_params: Optional[agentsociety.cityagent.firmagent.FirmAgentConfig] = None, blocks: Optional[list[agentsociety.agent.Block]] = None)

Bases: agentsociety.agent.FirmAgentBase

Agent representing a firm in an economic simulation.

Manages economic activities including price adjustments, wage policies, inventory control, and employee skill development. Inherits from InstitutionAgent and extends its economic behaviors.

Initialization

Initialize a FirmAgent with essential components for economic simulation.

  • Args:

    • name (str): The name or identifier of the agent.

    • toolbox (AgentToolbox): The toolbox of the agent.

    • memory (Memory): The memory of the agent.

  • Description:

    • Initializes the firm agent with the provided parameters and sets up necessary internal states.

ParamsType

None

description: str = <Multiline-String>
async reset()

Reset the FirmAgent.

async month_trigger()

Check if monthly adjustment should be triggered.

Compares current simulation time with last trigger time. Returns: True if time_diff has passed since last trigger, False otherwise

async forward()

Execute monthly economic adjustments.

Performs:

  • Employee skill adjustments based on market conditions

  • Price adjustments based on inventory/demand balance

  • Economic metrics reset (demand/sales tracking)