gabm.abm.democracy.election module

Election module for GABM.

class gabm.abm.democracy.election.Election(election_id: ElectionID, date: date, description: str)

Bases: object

For representing an election.

Attributes:

id (ElectionID): Unique identifier for the election. date (date): The date of the election. description (str): The description of the election.

class gabm.abm.democracy.election.ElectionID(election_id: int)

Bases: GABMID

A unique identifier for an Election instance.

Attributes:

election_id (int): The unique identifier for the election.

class gabm.abm.democracy.election.GeneralElection(election_id: ElectionID, date: date, description: str)

Bases: Election

For representing a general election.

Attributes:

id (ElectionID): Unique identifier for the election. date (date): The date of the election. description (str): The description of the election. candidates (Dict[str, str]): A dictionary mapping candidate names to their parties.

class gabm.abm.democracy.election.Referendum(election_id: ElectionID, date: date, description: str, question: str, choices: tuple[str, ...])

Bases: Election

For representing a referendum.

Attributes:

id (ElectionID): Unique identifier for the referendum. date (date): The date of the referendum. description (str): The description of the referendum. question (str): The question of the referendum. choices (tuple[str, …]): The choices for the referendum.

class gabm.abm.democracy.election.Vote(vote_id: VoteID, election_id: ElectionID, voter_id: str = None)

Bases: object

For representing a vote.

Attributes:
id (VoteID):

Unique identifier for the vote.

election_id (ElectionID):

The identifier of the election this vote is associated with.

voter_id (CitizenID):

The identifier of the voter.

class gabm.abm.democracy.election.VoteID(vote_id: int)

Bases: GABMID

A unique identifier for a Vote instance.

Attributes:

vote_id (int): The unique identifier for the vote.