Skip to content

directdemocracy-vote/judge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Judge

The sample judge provided in this reposity implements an algorithm calculing the reputation of citizens in directdemocracy.vote.

General algorithm

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
}

Detailed Functions and Terms

Distance Factor

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:

$$distanceFactor = 1 - {1 \over 1 + e^{10 - x \over 2}}$$

else if distance < 100km:

$$distanceFactor = {0.5 \over 0.9} (1 - 0.01x)$$

else

$$distanceFactor = 0$$

distance The red line is followed until 10km, and then we take the blue line into account.

Time Factor

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:

$$timeFactor = 1 - {1 \over 1 + e^{{(63072000000 - x) \over 8000000000}}}$$

time

**Note:**The time is expressed in milliseconds from the first January 1970.

Growth Factor

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:

$$growthFactor = {2 \over 1 + \sqrt{{totalReputation \over numberOfCitizens}}}$$

Where totalReputation is the sum of the reputation of all citizens

Reputation Function

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

$$reputation = {x^2 \over 18}$$

else

$$reputation = 1 - {0.75 \over x -1.5}$$

reputation The red line is followed until 3, and then we take the blue line into account.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •