TrustGrapher  r52
A playabale simulator for modelling trust between agents
D:/src/cu/trustGrapher/graphs/edges/SimReputationEdge.java
Go to the documentation of this file.
00001 
00002 package cu.trustGrapher.graphs.edges;
00003 
00004 import cu.repsystestbed.entities.Agent;
00005 import cu.repsystestbed.graphs.ReputationEdge;
00006 
00011 public class SimReputationEdge extends ReputationEdge {
00012 
00014 
00019     public SimReputationEdge(Agent src, Agent sink) {
00020         super(src, sink);
00021     }
00022 
00024 
00029     @Override
00030     public String toString(){
00031         String rawRep = "" + getReputation();
00032         int length = (rawRep.length() >= 4) ? 4 : rawRep.length();
00033         return rawRep.substring(0, length);
00034     }
00035 
00036     @Override
00037     public boolean equals(Object o){
00038         if (o instanceof SimReputationEdge){
00039             SimReputationEdge other = (SimReputationEdge) o;
00040         return (src.equals(other.src)) && (sink.equals(other.sink));
00041         }
00042         return false;
00043     }
00044 
00045     @Override
00046     public int hashCode() {
00047         int hash = 3;
00048         return hash;
00049     }
00050 }