Module flat

Source
Expand description

Contains FlatElection plugin models, which rank entities using a single aggregated scalar (flat weight) computed from a list of entities and their corresponding weights.

In this model:

  • Each entity is represented as a (entity, flat_weight) pair.
  • Individual contributions are not tracked separately; only the total flat weight per entity matters.
  • The plugin takes the list of entities with their flat weights and produces a ranked output.

§Characteristics

  • Requires a list of entities with their flat weights as input.
  • Produces a sorted list of entities according to their flat weight.
  • Ignores the structure or distribution of contributions, focusing purely on the aggregated value.

§Example Flow

  1. Prepare a list of entities with their flat weights: [(entity1, w1), (entity2, w2), ...].
  2. Pass this list to a FlatElection plugin model.
  3. The model sorts and outputs entities in descending order of flat weight.

Structs§

ThresholdFlatModel
The ThresholdFlat model filters candidates based on a minimum flat weight threshold. Only candidates whose weight meets or exceeds the threshold are included in the output.
ThresholdFlatModelConfig
Context Config for Plugin Model ThresholdFlatModel
TopDownFlatModel
The TopDownFlat model ranks candidates based solely on their aggregated flat weight. Each candidate’s score represents the total support or stake they possess.