Sim is the model. It stores inputs and processes them into outputs. Inputs are spatial election model geometries and election options. Processing is casting votes and applying a social choice function. Outputs are the election results.
See SimOld for the old documentation for sim.
- Parent page: Architecture
- Child pages: Commander, Entities, SimMode
Sim is composed of components.
- Changes keeps a list of changes to the Sim.
- Commander keeps track of commands sent to the Sim and stores them as a configuration. Undo and redo use these commands. Commander is like a middleman.
- Entities are geometric objects representing voters and candidates.
- SimOptions are outside of the election and include: mode and dimension.
- ElectionOptionsMan manages electionOptions. The electionOptions are options inside the election such as socialChoiceMethod. There are two sub categories:
- castOptions are options for the vote caster.
- socialChoiceOptions are options for the social choice function.
- DistrictGeometry creates geometries for voter districts. It does so by providing a modification of voter positions over a geographical space in tracts.
- SimMode is where the election happens and handles the processing of inputs geometries, options, and changes to output data structures.
- Pub allows the ViewMode to attach to the SimMode.