The sample judge provided in this reposity implements an algorithm calculing the reputation of citizens in directdemocracy.vote.
for 15 iterations // 15 is an arbitrary number. The goal is that the algorithm always converge.
for each citizen
sum = 0
for each link that endorse this citizen
sum += link reputation * distanceFactor * timeFactor
reputation = reputationFunction(growthFactor + sum)
if reputation > threshold // In our case the threshold is 0.5
citizen is endorsed
}
Goal: reduce the weight of endorsement links between two citizens in proportion to the distance between them.
Milestones taken into account when the functions were designed:
- The distance should have little or no impact in the first few kilometers.
- The link weight should be halved at 10 km.
- The link weight should be 0 when two citizens are more than 100 km apart.
Function: if distance < 10km:
else if distance < 100km:
else
The red line is followed until 10km, and then we take the blue line into account.
Goal: reduce the weight of endorsement links between two citizens as it ages.
Milestones taken into account when the functions were designed:
- The age should have little or no impact if the link is less than a year old.
- The link weight should be halved after 2 years.
- The link weight should be 0 after 3 years.
Function:
**Note:**The time is expressed in milliseconds from the first January 1970.
Goal: attribute a initial reputation to the nodes.
It should decrease when the global reputation increase because there is less need for an initial reputation and we want to favor links with other citizens.
The parameters of this function have been empirically defined. Function:
Where totalReputation is the sum of the reputation of all citizens
Goal: attribute a reputation to citizen.
The reputation should be bound between [0,1]. A citizen shoud need at least three strong endorsements to be endorsed.
Function: if x < 3
else
The red line is followed until 3, and then we take the blue line into account.