Package cu.repsystestbed.entities

Examples of cu.repsystestbed.entities.Agent


          if(feedback.value >= threshold2Satisfy) sij++;
          else sij--;
        }
       
        if(sij<1) sij=0;
        Agent sinkTemp = (Agent)edge.sink;
        if(this.agentIdmapping.get(source.id) > cijMatrix.length || this.agentIdmapping.get(sinkTemp.id) > cijMatrix.length)
          throw new Exception("Array out of bounds exception will occur. Problem with internal id mapping.");
        cijMatrix[this.agentIdmapping.get(source.id)][this.agentIdmapping.get(sinkTemp.id)] = sij;       
      }
    }
View Full Code Here


            if(feedback.value >= threshold2Satisfy) sij++;
            else sij--;
          }
         
          if(sij<1) sij=0;
          Agent sinkTemp = (Agent)edge.sink;
          if(this.agentIdmapping.get(source.id) > cijMatrix.length || this.agentIdmapping.get(sinkTemp.id) > cijMatrix.length)
            throw new Exception("Array out of bounds exception will occur. Problem with internal id mapping.");
          cijMatrix[this.agentIdmapping.get(source.id)][this.agentIdmapping.get(sinkTemp.id)] = sij;   
        }
      }
View Full Code Here

  private boolean nodeAlreadyVisited(ArrayList nodesVisited, Agent b)
  {
    Iterator it = nodesVisited.iterator();
    while(it.hasNext())
    {
      Agent a = (Agent)it.next();
      if(a.id == b.id) return true;
    }
    return false;
  }
View Full Code Here

          String agentIdString = (String) cell.getValue();
          try
          {
            int agentId = new Integer(agentIdString);
            Util.assertNotNull(m_viewer.m_graphModel);
            Set<TestbedEdge> edges = m_viewer.m_graphModel.incomingEdgesOf(new Agent(agentId));
            Util.assertNotNull(edges);
            if(edges.size() > 0)
            {
              display += "\n" + "Incoming Edges:" + "\n";
            }
           
            for(TestbedEdge e : edges)
            {
              display += e.src + "\n";
              if(e instanceof FeedbackHistoryGraphEdge)
              {
                FeedbackHistoryGraphEdge fhe = (FeedbackHistoryGraphEdge) e;
                display += "Feedbacks: "  + fhe.toString3() + "\n";
              }
              else if(e instanceof ReputationEdge)
              {
                ReputationEdge re = (ReputationEdge) e;
                display += "Reputation: "  + re.getReputation() + "\n";
              }
             
            }
           
            display += "--";
           
            edges = m_viewer.m_graphModel.outgoingEdgesOf(new Agent(agentId));
            Util.assertNotNull(edges);
            if(edges.size() > 0)
            {
              display += "\n" + "Outgoing Edges:" + "\n";
            }
View Full Code Here

     * @param id the ID of the agent that must exist
     * @param caller The graph to search in for the agent
     * @return An instance of the Agent that is to exist in the graph
     */
    protected Agent ensureAgentExists(int id, JungAdapterGraph<Agent, TestbedEdge> caller) {
        Agent tempAgent = new Agent(id);
        for (Agent agent : caller.getVertices()) {
            if (agent.equals(tempAgent)) {
                return agent;
            }
        }
View Full Code Here

     * @param event The TrustLogEvent that is being processed
     * @param forward Whether or not the graph is being played forward
     */
    @Override
    public void graphEvent(TrustLogEvent event, boolean forward) {
        Agent src = ensureAgentExists(event.getAssessor(), this), sink = ensureAgentExists(event.getAssessee(), this);
        SimFeedbackEdge dynEdge = (SimFeedbackEdge) ensureEdgeExists(src, sink, this);
        SimFeedbackEdge refEdge = (SimFeedbackEdge) referenceGraph.findEdge(src, sink);
        double feedback = event.getFeedback();
        if (forward) {
            //Add the feedback to the full edge so it can be seen in the viewer           
View Full Code Here

     * @param event The current event being processed that contains the ids of the assessor and assesse and feedback given
     */
    @Override
    public void graphConstructionEvent(TrustLogEvent event) {
        if (event != null) {
            Agent src = ensureAgentExists(event.getAssessor(), referenceGraph);
            Agent sink = ensureAgentExists(event.getAssessee(), referenceGraph);
            ensureEdgeExists(src, sink, referenceGraph);
        }
      
    }
View Full Code Here

   
  }
 
  public static void main(String[] args) throws Exception
  {
    Agent a = new Agent();
    Agent b = new Agent();
    Agent c = new Agent();
    Agent d = new Agent();
    Feedback tr = new Feedback(a,b,0.2);
    Feedback tr1 = new Feedback(c,b,0.2);
    Feedback tr2 = new Feedback(d,b,0.2);
    Feedback tr3 = new Feedback(b,a,0.2);
    Feedback tr4 = new Feedback(c,a,0.2);
View Full Code Here

      crnormi[i]=0;
    }
   
    for(int i=0;i<numArbitraryAgentsToPick;i++)
    {
      Agent arbAgent = new Agent(arbitraryAgents[i]);
      int complaintsAgainst = store.queryComplaintsAgainst(arbAgent, sink);
      logger.info("Complaints against:: Arbitrary agent " + arbAgent + " returned " + complaintsAgainst + " about " + sink);
      int complaintsFiled = store.queryComplaintsby(arbAgent, sink);
      logger.info("Complaints by:: Arbitrary agent " + arbAgent + " returned " + complaintsFiled + " about " + sink);
      cri[arbitraryAgents[i]] = complaintsAgainst;
View Full Code Here

  {
    ReputationGraph temp = new ReputationGraph(new ReputationEdgeFactory());
    Set<FeedbackHistoryGraphEdge> edges = f.edgeSet();
    for(FeedbackHistoryGraphEdge edge : edges)
    {
      Agent src = (Agent)edge.src;
      Agent sink = (Agent)edge.sink;
      temp.addVertex(src);
      temp.addVertex(sink);
      temp.addEdge(src, sink);
    }
    TransitiveClosure.INSTANCE.closeSimpleDirectedGraph(temp);
View Full Code Here

TOP

Related Classes of cu.repsystestbed.entities.Agent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.