Examples of Graph


Examples of Hack.Utilities.Graph

        isInputClocked = new boolean[inputPinsInfo.length];
        isOutputClocked = new boolean[outputPinsInfo.length];

        readParts(input);

        Graph graph = createConnectionsGraph();

        // runs the topological sort, starting from the "master parts" node,
        // which connects to all the parts. This will also check for circles.
        Object[] topologicalOrder = graph.topologicalSort(partsList);

        if (graph.hasCircle())
            throw new HDLException("This chip has a circle in its parts connections");

        // create the partsOrder array, by taking from the topologicalOrder
        // only the Integer objects, which represent the parts.
        partsOrder = new int[partsList.size()];
        int counter = 0;
        for (int i = 0; i < topologicalOrder.length; i++) {
            if (topologicalOrder[i] instanceof Integer)
                partsOrder[counter++] = ((Integer)topologicalOrder[i]).intValue();
        }

        // for each input pin, check if there is a path in the graph to an output pin
        // (actually to the "master output", which all outputs connect to).
        // If there is, the input is not clocked. Otherwise, it is.
        for (int i = 0; i < inputPinsInfo.length; i++)
            isInputClocked[i] = !graph.pathExists(inputPinsInfo[i], outputPinsInfo);

        // for each output pin, check if there is a path in the graph from any input pin
        // (actually from the "master input", which connects to all inputs) to this output pin.
        // If there is, the output is not clocked. Otherwise, it is.
        for (int i = 0; i < outputPinsInfo.length; i++)
            isOutputClocked[i] = !graph.pathExists(inputPinsInfo, outputPinsInfo[i]);
    }
View Full Code Here

Examples of att.grappa.Graph

  public Map<ITypeBinding, EclipseCFGNode> getExceptionalExits() {
    return excpReturns;
  }

  public Graph getDotGraph() {
    Graph graph = new Graph(name);
    startNode.addToGraph(graph);
    return graph;
  }
View Full Code Here

Examples of ch.akuhn.graph.Graph

            }
        }
    }
   
    public void computeShortestPathWithDijkstra() {
        Graph g = new Graph(graph);
        DijkstraAlgorithm2 dijsktra = new DijkstraAlgorithm2();
        for (int i = 0; i < n; i++) {
            /* NB: it is safe to update graph and use it for distances
             * in the same time since we only lookup the distances of
             * directly connected nodes, which are not updated.
View Full Code Here

Examples of ch.njol.skript.Metrics.Graph

        Skript.info(m_finished_loading.toString());
       
        EvtSkript.onSkriptStart();
       
        final Metrics metrics = new Metrics(Skript.this);
        final Graph scriptData = metrics.createGraph("data");
        scriptData.addPlotter(new Plotter("scripts") {
          @Override
          public int getValue() {
            return ScriptLoader.loadedScripts();
          }
        });
        scriptData.addPlotter(new Plotter("triggers") {
          @Override
          public int getValue() {
            return ScriptLoader.loadedTriggers();
          }
        });
        scriptData.addPlotter(new Plotter("commands") {
          @Override
          public int getValue() {
            return ScriptLoader.loadedCommands();
          }
        });
        scriptData.addPlotter(new Plotter("functions") {
          @Override
          public int getValue() {
            return ScriptLoader.loadedFunctions();
          }
        });
        scriptData.addPlotter(new Plotter("variables") {
          @Override
          public int getValue() {
            return Variables.numVariables();
          }
        });
        final Graph language = metrics.createGraph("language");
        language.addPlotter(new Plotter() {
          @Override
          public int getValue() {
            return 1;
          }
         
          @Override
          public String getColumnName() {
            return Language.getName();
          }
        });
        final Graph similarPlugins = metrics.createGraph("similar plugins");
        for (final String plugin : new String[] {"VariableTriggers", "CommandHelper", "Denizen", "rTriggers", "kTriggers", "TriggerCmds", "BlockScripts", "ScriptBlock", "buscript", "BukkitScript"}) {
          assert plugin != null;
          similarPlugins.addPlotter(new Plotter(plugin) {
            @Override
            public int getValue() {
              return Bukkit.getPluginManager().getPlugin(plugin) != null ? 1 : 0;
            }
          });
View Full Code Here

Examples of com.chap.links.client.Graph

          "  }]";
        JavaScriptObject jsonData = JsonUtils.safeEval(json);
        */

        // create the linechart, with data and options
        graph = new Graph(data, options);
       
        //graph.draw(jso, options);
       
        // add event handlers
        graph.addRangeChangeHandler(createRangeChangeHandler(graph));
View Full Code Here

Examples of com.comphenix.protocol.metrics.Metrics.Graph

    metrics.start();
  }
 
  private void addPluginUserGraph(Metrics metrics) {
 
    Graph pluginUsers = metrics.createGraph("Plugin Users");
   
    for (Map.Entry<String, Integer> entry : getPluginUsers(ProtocolLibrary.getProtocolManager()).entrySet()) {
      final int count = entry.getValue();
     
      // Plot plugins of this type
      pluginUsers.addPlotter(new Metrics.Plotter(entry.getKey()) {
        @Override
        public int getValue() {
          return count;
        }
      });
View Full Code Here

Examples of com.dianping.cat.core.dal.Graph

    List<Graph> graphs = new ArrayList<Graph>(ips.size() + 1);
    Map<String, GraphLine> allDetailCache = new TreeMap<String, GraphLine>();
    Map<String, GraphLine> allSummaryCache = new TreeMap<String, GraphLine>();
    Date creationDate = new Date();
    for (String ip : ips) {
      Graph graph = new Graph();
      graph.setIp(ip);
      graph.setDomain(domainName);
      graph.setName(reportName);
      graph.setPeriod(reportPeriod);
      graph.setType(3);
      graph.setCreationDate(creationDate);
      Machine machine = eventReport.getMachines().get(ip);
      Map<String, EventType> types = machine.getTypes();
      StringBuilder detailBuilder = new StringBuilder();
      StringBuilder summaryBuilder = new StringBuilder();
      for (Entry<String, EventType> eventEntry : types.entrySet()) {
        EventType eventType = eventEntry.getValue();
        long[] typeCounts = new long[60];
        long[] typeFails = new long[60];

        Map<String, EventName> names = eventType.getNames();
        for (Entry<String, EventName> nameEntry : names.entrySet()) {
          EventName eventName = nameEntry.getValue();
          List<Range> ranges = new ArrayList<Range>(eventName.getRanges().values());
          detailBuilder.append(eventType.getId());
          detailBuilder.append('\t');
          detailBuilder.append(eventName.getId());
          detailBuilder.append('\t');

          long[] totalCount = getTotalCount(ranges);
          detailBuilder.append(arrayToString(totalCount));
          detailBuilder.append('\t');
          long[] failCount = getFailsCount(ranges);
          detailBuilder.append(arrayToString(failCount));
          detailBuilder.append('\n');

          String key = eventType.getId() + "\t" + eventName.getId();
          GraphLine detailLine = allDetailCache.get(key);
          if (detailLine == null) {
            detailLine = new GraphLine();
            allDetailCache.put(key, detailLine);
          }

          detailLine.totalCounts = arrayAdd(detailLine.totalCounts, totalCount);
          detailLine.failCounts = arrayAdd(detailLine.failCounts, failCount);

          typeCounts = arrayAdd(typeCounts, totalCount);
          typeFails = arrayAdd(typeFails, failCount);
        }

        String summaryKey = eventType.getId();
        GraphLine summaryLine = allSummaryCache.get(summaryKey);
        if (summaryLine == null) {
          summaryLine = new GraphLine();
          allSummaryCache.put(summaryKey, summaryLine);
        }
        summaryLine.totalCounts = arrayAdd(summaryLine.totalCounts, typeCounts);
        summaryLine.failCounts = arrayAdd(summaryLine.failCounts, typeFails);

        summaryBuilder.append(eventType.getId());
        summaryBuilder.append('\t');
        summaryBuilder.append(arrayToString(typeCounts));
        summaryBuilder.append('\t');
        summaryBuilder.append(arrayToString(typeFails));
        summaryBuilder.append('\n');
      }
      graph.setDetailContent(detailBuilder.toString());
      graph.setSummaryContent(summaryBuilder.toString());
      graphs.add(graph);
    }

    Graph allGraph = new Graph();
    allGraph.setIp("all");
    allGraph.setDomain(domainName);
    allGraph.setName(reportName);
    allGraph.setPeriod(reportPeriod);
    allGraph.setType(3);
    allGraph.setCreationDate(creationDate);

    StringBuilder detailSb = new StringBuilder();
    for (Entry<String, GraphLine> entry : allDetailCache.entrySet()) {
      detailSb.append(entry.getKey());
      detailSb.append('\t');
      GraphLine value = entry.getValue();
      detailSb.append(arrayToString(value.totalCounts));
      detailSb.append('\t');
      detailSb.append(arrayToString(value.failCounts));
      detailSb.append('\t');
      detailSb.append('\n');
    }
    allGraph.setDetailContent(detailSb.toString());

    StringBuilder summarySb = new StringBuilder();
    for (Entry<String, GraphLine> entry : allSummaryCache.entrySet()) {
      summarySb.append(entry.getKey());
      summarySb.append('\t');
      GraphLine value = entry.getValue();
      summarySb.append(arrayToString(value.totalCounts));
      summarySb.append('\t');
      summarySb.append(arrayToString(value.failCounts));
      summarySb.append('\n');
    }
    allGraph.setSummaryContent(summarySb.toString());
    graphs.add(allGraph);
    return graphs;
  }
View Full Code Here

Examples of com.github.zathrus_writer.commandsex.helpers.Metrics.Graph

    // don't start metrics if the user has disabled it
    if (getConf().getBoolean("pluginMetrics")){
      try {
          metrics = new Metrics(plugin);
         
          Graph featureGraph = metrics.createGraph("Feature Statistics");
          if (loadedClasses.contains("Init_Home")){
            featureGraph.addPlotter(new Metrics.Plotter("Homes Set") {
            @Override
              public int getValue() {
              int count = 0;
              try {
                ResultSet rs = SQLManager.query_res("SELECT player_name FROM " + SQLManager.prefix + "homes");
                while (rs.next()){
                  count++;
                }
                rs.close();
              } catch (SQLException e){
                e.printStackTrace();
              }
             
              return count;
            }
          });
          }
         
          if (loadedClasses.contains("Init_Warps")){
            featureGraph.addPlotter(new Metrics.Plotter("Warps Set") {
            @Override
            public int getValue() {
              int count = 0;
              try {
                ResultSet rs = SQLManager.query_res("SELECT owner_name FROM " + SQLManager.prefix + "warps");
                while (rs.next()){
                  count++;
                }
                rs.close();
              } catch (SQLException e){
                e.printStackTrace();
              }
             
              return count;
            }
          });
          }
         
          if (loadedClasses.contains("Init_Nicknames")){
            featureGraph.addPlotter(new Metrics.Plotter("Nicknames Set") {
            @Override
            public int getValue() {
              int count = 0;
              try {
                ResultSet rs = SQLManager.query_res("SELECT player_name FROM " + SQLManager.prefix + "nicknames");
                while (rs.next()){
                  count++;
                }
                rs.close();
              } catch (SQLException e){
                e.printStackTrace();
              }
             
              return count;
            }
          });
          }
         
          if (loadedClasses.contains("Init_Nametags")){
            featureGraph.addPlotter(new Metrics.Plotter("Nametags Set") {
            @Override
            public int getValue() {
              int count = 0;
              try {
                ResultSet rs = SQLManager.query_res("SELECT player_name FROM " + SQLManager.prefix + "nametags");
                while (rs.next()){
                  count++;
                }
                rs.close();
              } catch (SQLException e){
                e.printStackTrace();
              }
             
              return count;
            }
          });
          }
         
          if (loadedClasses.contains("Init_Kits")){
            featureGraph.addPlotter(new Metrics.Plotter("Kits Set") {
            @Override
            public int getValue() {
              int count = 0;
              FileConfiguration f = CommandsEX.getConf();
              ConfigurationSection configGroups = f.getConfigurationSection("kits");
              if (configGroups != null){
                Set<String> kitGroups = configGroups.getKeys(false);

                for (String group : kitGroups) {
                  ConfigurationSection kits = f.getConfigurationSection("kits." + group);
                  Set<String> kitNames = kits.getKeys(false);
                  count = count + kitNames.size();
                }
              }
             
              return count;
            }
            });
          }

          // Add commands to Command Uses graph, these items must be present
          // when the server starts up otherwise the graph cannot be sent
          Graph commandUsesGraph = metrics.createGraph("Command Uses");
          for (final String s : loadedClasses){
            if (s.startsWith("Command_cex_")){
              String key = s.replaceAll("Command_cex_", "/");
             
              commandUsesGraph.addPlotter(new Metrics.Plotter(key) {
                @Override
                public int getValue() {
                  return (commandUses.containsKey(s) ? commandUses.get(s) : 0);
                }
              });
View Full Code Here

Examples of com.hp.hpl.jena.graph.Graph

                return new QueryIterNullIterator(execCxt) ;
        }
       
        //Set bindings = new HashSet() ;    // Use a Set if you want unique results.
        List<Binding> bindings = new ArrayList<Binding>() ;   // Use a list if you want counting results.
        Graph graph = execCxt.getActiveGraph() ;
       
        ExtendedIterator<Triple>iter = graph.find(Node.ANY, Node.ANY, Node.ANY) ;
        for ( ; iter.hasNext() ; )
        {
            Triple t = iter.next() ;
            slot(bindings, input, t.getSubject(),   subjVar, nodeLocalname) ;
            slot(bindings, input, t.getPredicate(), subjVar, nodeLocalname) ;
View Full Code Here

Examples of com.khorn.terraincontrol.bukkit.metrics.Metrics.Graph

        // When you update this method, also check the Forge class!
        try
        {
            Metrics metrics = new Metrics(plugin);

            Graph usedBiomeModesGraph = metrics.createGraph("Biome modes used");

            usedBiomeModesGraph.addPlotter(new Metrics.Plotter("Normal")
            {
                @Override
                public int getValue()
                {
                    return normalMode;
                }
            });
            usedBiomeModesGraph.addPlotter(new Metrics.Plotter("FromImage")
            {
                @Override
                public int getValue()
                {
                    return fromImageMode;
                }
            });
            usedBiomeModesGraph.addPlotter(new Metrics.Plotter("Default")
            {
                @Override
                public int getValue()
                {
                    return vanillaMode;
                }
            });
            usedBiomeModesGraph.addPlotter(new Metrics.Plotter("OldGenerator")
            {
                @Override
                public int getValue()
                {
                    return oldBiomeMode;
                }
            });
            usedBiomeModesGraph.addPlotter(new Metrics.Plotter("Custom / Unknown")
            {
                @Override
                public int getValue()
                {
                    return customMode;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.