TrustGrapher
r52
A playabale simulator for modelling trust between agents
|
00001 package cu.repsystestbed.graphs; 00002 00003 import cu.repsystestbed.entities.Agent; 00004 00005 public class ReputationEdge extends TestbedEdge implements Comparable 00006 { 00007 00008 private static final long serialVersionUID = -6027745106941999388L; 00009 private double reputation; //not used. 00010 00011 public ReputationEdge(Agent src, Agent sink, double reputation) 00012 { 00013 super.src = src; 00014 super.sink = sink; 00015 this.setReputation(reputation); 00016 } 00017 00018 public ReputationEdge(Agent src, Agent sink) 00019 { 00020 super.src = src; 00021 super.sink = sink; 00022 this.setReputation(Double.MIN_VALUE); 00023 } 00024 00025 public void setReputation(double reputation) 00026 { 00027 this.reputation = reputation; 00028 } 00029 00030 public double getReputation() 00031 { 00032 return reputation; 00033 } 00034 00035 @Override 00036 public int compareTo(Object arg0) 00037 { 00038 ReputationEdge otherEdge = (ReputationEdge)arg0; 00039 if(this.getWeight() < otherEdge.getWeight()) return -1; 00040 else if(this.getWeight() > otherEdge.getWeight()) return 1; 00041 else return 0; 00042 00043 } 00044 00045 00046 00047 }