Module elections

Source
Expand description

Provides generic traits for election management, weight computation, and influence calculation using plugin-based models.

The traits include:

§Note

Elections are pluggable by design, meaning:

  • The inputs generally consist of candidates along with their backing weights (or votes).
  • The outputs can be a single candidate or a collection of candidates (stored via an iterator).

Because of this, we define generic plugin-based traits, enabling:

  1. Multiple election models to be implemented over the same trait interfaces.
  2. Flexible storage and computation strategies depending on the election logic.
  3. Strong type-safety while maintaining runtime configurability via plugins.

Traits§

ElectionManager
A trait for managing elections of candidates with associated weights.
Influence
A trait for computing influence, a normalized and comparable metric representing the relative power or importance of an entity.
InspectWeight
Trait for inspecting the weight of a candidate for an upcoming election.