Package cu.repsystestbed.entities

Examples of cu.repsystestbed.entities.Agent


        for(int i=0;i<temp.numValues();i++)
        {
          //number of values == 3
          feedbackInstance[i] = temp.stringValue(i);         
        }
        Agent src = new Agent(new Integer(feedbackInstance[0]));
        Agent sink = new Agent(new Integer(feedbackInstance[1]));
        Double reputation = new Double(feedbackInstance[2]);
       
        if(!repGraph.containsVertex(src))
        {
          repGraph.addVertex(src);
View Full Code Here


    int initialSize = edges.size();
   
    Set<TestbedEdge> tempEdges = graph.outgoingEdgesOf(src);
    for(TestbedEdge e : tempEdges)
    {
      Agent tempSink = (Agent) e.sink;
      if(tempSink != null)
      {
        if(isPresent(agentsVisited, tempSink))
        {
          if(errorAtLoop) throw new Exception("Loop found. Stopping DFS.");
        }
        else
        {
          agentsVisited.add(src);
          if(tempSink.equals(sink))
          {
            edges.add(e);
          }
          else
          {
View Full Code Here

    }
 
  public static void main(String[] args) throws Exception
  {
    ReputationGraph repGraph = new ReputationGraph(new ReputationEdgeFactory());
    Agent a0 = new Agent();
    Agent a1 = new Agent();
    Agent a2 = new Agent();
    Agent a3 = new Agent();
    Agent a4 = new Agent();
   
    repGraph.addVertex(a0);
    repGraph.addVertex(a1);
    repGraph.addVertex(a2);
    repGraph.addVertex(a3);
View Full Code Here

    if(produceCompleteGraph)
    {
      Set<FeedbackHistoryGraphEdge> edges = ((FeedbackHistoryGraph)this.m_graph2Listen).edgeSet();
      for(FeedbackHistoryGraphEdge edge : edges)
      {
        Agent src = (Agent)edge.src;
        Agent sink = (Agent)edge.sink;
        m_graph2Output.addVertex(src);
        m_graph2Output.addVertex(sink);
        m_graph2Output.addEdge(src, sink);
      }
    }
    else
    {
      FeedbackHistoryGraph feedbackHistoryGraphTransitive = ((FeedbackHistoryGraph)this.m_graph2Listen).getTransitiveClosureGraph();
      Set<FeedbackHistoryGraphEdge> edges = feedbackHistoryGraphTransitive.edgeSet();
      for(FeedbackHistoryGraphEdge edge : edges)
      {
        Agent src = (Agent)edge.src;
        Agent sink = (Agent)edge.sink;
        m_graph2Output.addVertex(src);
        m_graph2Output.addVertex(sink);
        m_graph2Output.addEdge(src, sink);
      }
    }
View Full Code Here

    if(produceCompleteGraph)
    {
      Set<ReputationEdge> edges = ((ReputationGraph)super.m_graph2Listen).edgeSet(); //should be ok to cast here
      for(ReputationEdge edge : edges)
      {
        Agent src = (Agent)edge.src;
        Agent sink = (Agent)edge.sink;
        m_graph2Output.addVertex(src);
        m_graph2Output.addVertex(sink);
        m_graph2Output.addEdge(src, sink);
        //not copying the reputation weights. should you? Probably not.
      }
     
    }else
    {
      ReputationGraph ReputationGraphTransitive = ((ReputationGraph)this.m_graph2Listen).getTransitiveClosureGraph();
      Set<ReputationEdge> edges = ReputationGraphTransitive.edgeSet();
      for(ReputationEdge edge : edges)
      {
        Agent src = (Agent)edge.src;
        Agent sink = (Agent)edge.sink;
        m_graph2Output.addVertex(src);
        m_graph2Output.addVertex(sink);
        m_graph2Output.addEdge(src, sink);
      }
     
View Full Code Here

       * Find the transitive closure edges of the input graph and add them to the output grph
       */
      Graph graphTransitive = ((Graph)this.m_graph2Listen).getTransitiveClosureGraph();
      for(TestbedEdge edge : (Set<TestbedEdge>)graphTransitive.edgeSet())
      {
        Agent src = (Agent)edge.src;
        Agent sink = (Agent)edge.sink;
        m_graph2Output.addVertex(src);
        m_graph2Output.addVertex(sink);
        m_graph2Output.addEdge(src, sink);
      }
    }
    else if(outputGraphType == OutputGraphType.COPY_INPUT_GRAPH)
    {
      /*
       * Copy the edges in the input graph to the output graph
       */
      Set<TestbedEdge> edges = ((Graph)this.m_graph2Listen).edgeSet();
      for(TestbedEdge edge : edges)
      {
        Agent src = (Agent)edge.src;
        Agent sink = (Agent)edge.sink;
        m_graph2Output.addVertex(src);
        m_graph2Output.addVertex(sink);
        m_graph2Output.addEdge(src, sink);
      }
    }
View Full Code Here

        for(int i=0;i<temp.numValues();i++)
        {
          //number of values == 2
          feedbackInstance[i] = temp.stringValue(i);         
        }
        Agent src = new Agent(new Integer(feedbackInstance[0]));
        Agent sink = new Agent(new Integer(feedbackInstance[1]));
       
        if(!trustGraph.containsVertex(src))
        {
          trustGraph.addVertex(src);
        }
View Full Code Here

   
    //we have all the groups and the strategies associated with them. Now generate the feedbacks
    //create the agents first
    for(Group g : groups)
    {
      for(int i=0;i<g.getMaxNumOfAgents();i++) g.joinGroup(new Agent());
    }
    //create the feedbacks based on the strategies
    for(Group sourceGroup : groups)
    {
      for(TargetGpStrAssignment assignment : sourceGroup.getTargetGpStrategyAssignments())
View Full Code Here

        for(int i=0;i<temp.numValues();i++)
        {
          //number of values == 3
          feedbackInstance[i] = temp.stringValue(i);         
        }
        Agent assessor = new Agent(new Integer(feedbackInstance[0]));
        Agent assessee = new Agent(new Integer(feedbackInstance[1]));
        Double value = new Double(feedbackInstance[2]);
       
        Feedback f = new Feedback(assessor, assessee, value);
        feedbacks.add(f);
        logger.info("Added " + f );
View Full Code Here

    try
    {
      //add vertices
      for(Object o : m_graphModel.vertexSet())
      {
        Agent a = (Agent) o;
        mxCell cell = (mxCell) m_graph.insertVertex(parent, new Integer(a.id).toString(), new Integer(a.id).toString(), 20, 20, 20, 20, "ROUNDED");
        jGraphCells.put(new Integer(a.id).toString(), cell);
      }
      //add edges
      for(Object o : m_graphModel.edgeSet())
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.