Giter Site home page Giter Site logo

trust_gaurd's Introduction

TrustGuard

This is my implementation of the algorithm described in TrustGaurd: Countering Vulnerabilities in Reputation Management for Decentralized Overlay Networks.. I haven't tested it. I just wanted to write it in code so that I could figure out what each piece meant.

Also, I realize I misspelled guard as gaurd everywhere. Its just one of those words I misspell all the time and its not worth fixing.

Usage

require 'trust_gaurd'

# current raw trust value gets 2/3rds of the importance
alpha = 0.66

# previous raw trust values get 1/3rd of the importance
beta = 0.34

# a positive change in reputation rewards double the change
pos_gamma = 2

# a negative change in reputation punishes four times the change
neg_gamma = 4

# the importance of previous raw trust values degrades by a factor of 0.5
p = 0.5

tv = TrustGaurd::TrustValue.new(alpha, beta, pos_gamma, neg_gamma, p)

# Gets all of raw trust value, nothing from history, and no change
tv.calculate([100])                   #=> 66.0
# Gets all of raw trust value, all of history, and no change
tv.calculate([100, 100])              #=> 100.0
# Gets 95% of raw trust value, all of history, and -5 * 4 change
tv.calculate([100, 100, 95])          #=> 76.70000000000006
# The rest gets a bit complicated...
tv.calculate([100, 100, 95, 95])      #=> 87.15714285714287
tv.calculate([100, 100, 95, 95, 77])  #=> 7.460000000000008

Variables

Some notes about varying these values:

  • When alpha > beta, history does not have as much significance as the current value. The opposite is also true.
  • When pos_gamma is large, it is easier to obtain a higher trust value over time. The authors that propose this algorithm suggest that it be hard to get a good reputation.
  • When pos_gamma is large, there is a large penalty for a bad reputation. The authors that propose this algorithm suggest that reputation be lost quickly if the raw trust history decreases radically.
  • When p = 1, all previous raw trust values are treated equally. Generally, more recent ones should have more significance. Therefore, a p value < 1 is preferable.

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

Copyright

Copyright (c) 2010 Allen Madsen. See LICENSE for details.

trust_gaurd's People

Contributors

blatyo avatar

Stargazers

Tyler Ewing avatar  avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.