Package cu.repsystestbed.graphs

Examples of cu.repsystestbed.graphs.Graph


    if(outputGraphType == OutputGraphType.COMPLETE_GRAPH)
    {
      /*
       * For every src and sink in the input graph, create an edge in the output graph
       */
      Graph graphTransitive = ((Graph)this.m_graph2Listen).getTransitiveClosureGraph();
      for(Agent src: (Set<Agent>) graphTransitive.vertexSet())
      {
        for(Agent sink: (Set<Agent>) graphTransitive.vertexSet())
        {
          if(!src.equals(sink))
          {
            m_graph2Output.addVertex(src);
            m_graph2Output.addVertex(sink);
            m_graph2Output.addEdge(src, sink);
          }
         
        }
      }
    }
    else if(outputGraphType == OutputGraphType.TRANSITIVE_GRAPH)
    {
      /*
       * 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);
View Full Code Here


       * Calculate trust scores of sink agents that are reachable from the source.
       * that is determine the transitive closure of the graph that this alg listens to
       * and set the weights of the edges.
       */
     
      Graph transitiveGraph = m_graph2Listen.getTransitiveClosureGraph();
      
      for(Agent src : agents)
      {
        Set<TestbedEdge> outgoingEdges = transitiveGraph.outgoingEdgesOf(src);
        for(TestbedEdge e : outgoingEdges)
        {
          double trustScore = calculateTrustScore(src, (Agent)e.sink);
          if(!assertVariablePrecondition(trustScore))
          {
View Full Code Here

       
        if(isGraph(workflowElements[i].trim()))
        {
          try
          {
            Graph graph = createGraphInstance(workflowElements[i].trim());
            Util.assertNotNull(graph);
            m_workflow.addItem(graph);
           
          }
          catch(Exception e)
View Full Code Here

    {
      throw new WorkflowParserException("The first element in the workflow must be either " +
          "a feedbackhistorygraph, reputationgraph or a trustgraph");
    }
     
    Graph graph;
    if(graphType.equalsIgnoreCase(FEEDBACKHISTORYGRAPH))
    {
      return new FeedbackHistoryGraph(new FeedbackHistoryEdgeFactory());
     
    }
View Full Code Here

TOP

Related Classes of cu.repsystestbed.graphs.Graph

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.