gabm.abm.attribute module
Generic attribute base classes for GABM.
- class gabm.abm.attribute.GABMAttribute(id: GABMID, description: str)
Bases:
objectGeneric base class for attributes (e.g., Gender, Health).
- Attributes:
id: Unique identifier object (e.g., GenderID, HealthID). description (str): Description of the attribute.
- class gabm.abm.attribute.GABMAttributeID(attribute_id: int)
Bases:
GABMIDIdentifier for GABM attributes.
- Attributes:
id (int): The unique identifier.
- class gabm.abm.attribute.GABMAttributeMap(items: dict[GABMID, GABMAttribute])
Bases:
objectGeneric base class for attribute maps (e.g., GenderMap, HealthMap).
- Attributes:
_map (dict): Mapping from ID objects to attribute instances.
- T = ~T
- add(attr: GABMAttribute)
Add an attribute to the map.
- Args:
attr: An instance of an attribute (e.g., Gender, Health).
- items()
- Return:
An iterable of (ID object, attribute instance) pairs in the map.
- keys()
- Return:
An iterable of the ID objects in the map.
- values()
- Return:
An iterable of the attribute instances in the map.