gabm.abm.environment module
Environment module for GABM.
- class gabm.abm.environment.Environment(year: int = 2026, place: str = 'Earth', gender_map: GenderMap = None, opinions: Dict[OpinionTopicID, Opinion] = None)
Bases:
objectAn Environment with opinions.
- Attributes:
- year (int):
The current year in the simulation.
- place (str):
The name of the place or environment.
- agents_active (Dict[AgentID, Agent]):
A dictionary of active agents in the environment.
- agents_inactive (Dict[AgentID, Agent]):
A dictionary of inactive agents in the environment.
- groups_active (Dict[GroupID, Group]):
A dictionary of active groups in the environment.
- groups_inactive (Dict[GroupID, Group]):
A dictionary of inactive groups in the environment.
- gender_map (GenderMap):
A map for gender attribute lookups.
- opinions (Dict[OpinionTopicID, Opinion]):
A dictionary of opinions. The key is an OpinionTopicID, the value is an Opinion object.
- class gabm.abm.environment.Nation(year: int = 2026, place: str = 'Earth', gender_map: GenderMap = None, opinions: Dict[OpinionTopicID, Opinion] = None, region_map: RegionMap = None, education_map: EducationMap = None, ethnicity_map: EthnicityMap = None, employment_map: EmploymentMap = None, income_map: IncomeMap = None, nation: str = None)
Bases:
EnvironmentAn Environment representing a nation. Can be extended with nation-specific attributes and methods.
Note
Inherits all attributes from
Environment.- Attributes:
- citizens (Group):
A group of Person agents representing the citizens of the nation.
- visitors (Group):
A group of Person agents representing the visitors in the nation.
- region_map (UKRegionMap):
A UKRegionMap instance for region attribute lookups.
- education_map (SurveyEducationMap):
A SurveyEducationMap instance for education attribute lookups.
- ethnicity_map (SurveyEthnicityMap):
A SurveyEthnicityMap instance for ethnicity attribute lookups.
- employment_map (SurveyEmploymentMap):
A SurveyEmploymentMap instance for employment attribute lookups.
- income_map (SurveyIncomeMap):
A SurveyIncomeMap instance for income attribute lookups.
- nation (str):
The name of the nation.