Examples of Graph


Examples of org.mcstats.Metrics.Graph

      if (War.war.getWarzones().size() > 0) {
        War.war.log("Warzones ready.", Level.INFO);
        final int zones = War.war.getWarzones().size();
        try {
          Metrics metrics = new Metrics(War.war);
          Graph warzoneCount = metrics.createGraph("Warzones");
          warzoneCount.addPlotter(new FixedPlotter("Count", zones));
          Graph language = metrics.createGraph("Language");
          String langName = War.war.getLoadedLocale().getDisplayLanguage(Locale.ENGLISH);
          if (langName.isEmpty()) {
            langName = "English";
          }
          language.addPlotter(new PlotterEnabled(langName));
          Graph plugins = metrics.createGraph("Extensions");
          if (War.war.isSpoutServer()) {
            plugins.addPlotter(new PlotterEnabled("Spout"));
          }
          if (War.war.isTagServer()) {
            plugins.addPlotter(new PlotterEnabled("TagAPI"));
          }
          if (Bukkit.getPluginManager().isPluginEnabled("WorldEdit")) {
            plugins.addPlotter(new PlotterEnabled("WorldEdit"));
          }
          plugins.addPlotter(new PlotterEnabled("War")); // of course
          metrics.start();
        } catch (IOException ignored) {
        }
      }
    }
View Full Code Here

Examples of org.melonbrew.fe.Metrics.Graph

    private void loadMetrics() {
        try {
            Metrics metrics = new Metrics(this);

            Graph databaseGraph = metrics.createGraph("Database Engine");

            databaseGraph.addPlotter(new Plotter(getFeDatabase().getName()) {
                public int getValue() {
                    return 1;
                }
            });

            Graph defaultHoldings = metrics.createGraph("Default Holdings");

            defaultHoldings.addPlotter(new Plotter(getAPI().getDefaultHoldings() + "") {
                public int getValue() {
                    return 1;
                }
            });

            Graph maxHoldings = metrics.createGraph("Max Holdings");

            String maxHolding = getAPI().getMaxHoldings() + "";

            if (getAPI().getMaxHoldings() == -1) {
                maxHolding = "Unlimited";
            }

            maxHoldings.addPlotter(new Plotter(maxHolding) {
                public int getValue() {
                    return 1;
                }
            });
View Full Code Here

Examples of org.openjgraph.model.Graph

            budget.addExpenditure(exp5);
            budget.addExpenditure(exp6);

            BudgetService bs = new BudgetService(new AdjacencyMatrixGraphFactory());

            Graph graph = bs.resolveBudget(budget);
            assertEquals(graph.getVertexSet().size(), 4);

            Set<String> personIdSet = new HashSet<String>(4);
            personIdSet.add(p1.getId());
            personIdSet.add(p2.getId());
            personIdSet.add(p3.getId());
            personIdSet.add(p4.getId());

            for(Vertex vertex : graph.getVertexSet()) {
                assertTrue(personIdSet.contains(vertex.getId()));
                if(vertex.getId().equals(p1.getId())){
                    assertEquals(vertex.getDegree(),7000);
                }
                if(vertex.getId().equals(p2.getId())){
View Full Code Here

Examples of org.openrdf.model.Graph

    private SolrInputDocument indexEntityState( final EntityState entityState,
                                                final SolrServer server )
            throws IOException, SolrServerException, JSONException
    {
        Graph graph = new GraphImpl();
        stateSerializer.serialize( entityState, false, graph );

        SolrInputDocument input = new SolrInputDocument();
        input.addField( "id", entityState.identity().identity() );
        input.addField( "type", first(entityState.entityDescriptor().types()).getName() );
        input.addField( "lastModified", new Date( entityState.lastModified() ) );

        for( Statement statement : graph )
        {
            SchemaField field = indexedFields.get( statement.getPredicate().getLocalName() );
            if( field != null )
            {
                if( statement.getObject() instanceof Literal )
                {
                    String value = statement.getObject().stringValue();
                    if( field.getType().getTypeName().equals( "json" ) )
                    {
                        if( value.charAt( 0 ) == '[' )
                        {
                            JSONArray array = new JSONArray( value );
                            indexJson( input, array );
                        } else if( value.charAt( 0 ) == '{' )
                        {
                            JSONObject object = new JSONObject( value );
                            indexJson( input, object );
                        }
                    } else
                    {
                        input.addField( field.getName(), value );
                    }
                } else if( statement.getObject() instanceof URI && !"type".equals( field.getName() ) )
                {
                    String value = statement.getObject().stringValue();
                    value = value.substring( value.lastIndexOf( ':' ) + 1, value.length() );
                    String name = field.getName();
                    input.addField( name, value );
                } else if( statement.getObject() instanceof BNode )
                {
                    Iterator<Statement> seq = graph.match( (Resource) statement.getObject(), new URIImpl( "http://www.w3.org/1999/02/22-rdf-syntax-ns#li" ), null, (Resource) null );
                    while( seq.hasNext() )
                    {
                        Statement seqStatement = seq.next();
                        String value = seqStatement.getObject().stringValue();
                        value = value.substring( value.lastIndexOf( ':' ) + 1, value.length() );
View Full Code Here

Examples of org.opentripplanner.routing.core.Graph

    List<StopEntry> hubStops = loadHubStops();
    List<StopEntry> stops = loadSourceStops(hubStops);

    Set<StopEntry> hubStopsAsSet = new HashSet<StopEntry>(hubStops);

    Graph graph = _graphService.getGraph();
    GraphContext context = _otpConfigurationService.createGraphContext();

    Map<AgencyAndId, MutableTransferPattern> patternsByStopId = new HashMap<AgencyAndId, MutableTransferPattern>();

    for (StopEntry stop : stops) {
View Full Code Here

Examples of org.opentripplanner.routing.graph.Graph

        states = path.states.toArray(states);

        Edge[] edges = new Edge[path.edges.size()];
        edges = path.edges.toArray(edges);

        Graph graph = path.getRoutingContext().graph;

        FareService fareService = graph.getService(FareService.class);

        State[][] legsStates = sliceStates(states);

        if (fareService != null) {
            itinerary.fare = fareService.getCost(path);
View Full Code Here

Examples of org.restlet.ext.rdf.Graph

     * @param userRef
     *            Its URI.
     * @return The FOAF representation of a user.
     */
    protected Representation getFoafRepresentation(User user, Reference userRef) {
        Graph graph = new Graph();
        addFoaf(graph, user, userRef);
        return new RdfRepresentation(graph, MediaType.TEXT_XML);
    }
View Full Code Here

Examples of org.securegraph.Graph

                systemNotificationRepository.shutdown();
            }

            LOGGER.info("shutdown: Graph");
            if (InjectHelper.hasInjector()) {
                Graph graph = InjectHelper.getInstance(Graph.class);
                graph.shutdown();
            }

            Thread.sleep(1000);

            if (!LumifyTestClusterConfigurationLoader.isTestServer()) {
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.ui.graph.model.Graph

             
             
              final GraphEditorInput input = (GraphEditorInput) getEditorInput();
              input.init();

              final Graph graph = new Graph(input);
              graph.init();

              Display.getDefault().asyncExec(new Runnable() {

                public void run() {
                  if (getGraphicalViewer() != null && getGraphicalViewer().getControl() != null) {
                    setPartName(input.getName());
                    setContentDescription(input.getToolTipText());

                    graph.layout(getGraphicalViewer().getControl().getFont());
                    getGraphicalViewer().setContents(graph);
                  }
                }
              });
            }
View Full Code Here

Examples of org.teavm.common.Graph

        BasicBlock block;
    }

    private void renameVariables() {
        DominatorTree domTree = GraphUtils.buildDominatorTree(ProgramUtils.buildControlFlowGraph(program));
        Graph domGraph = GraphUtils.buildDominatorGraph(domTree, program.basicBlockCount());
        Task[] stack = new Task[cfg.size() * 2];
        int head = 0;
        for (int i = 0; i < program.basicBlockCount(); ++i) {
            if (domGraph.incomingEdgesCount(i) == 0) {
                Task task = new Task();
                task.block = program.basicBlockAt(i);
                task.variables = Arrays.copyOf(variableMap, variableMap.length);
                stack[head++] = task;
            }
        }

        List<List<TryCatchBlock>> caughtBlocks = new ArrayList<>();
        List<List<Phi>> specialPhis = new ArrayList<>();
        for (int i = 0; i < program.basicBlockCount(); ++i) {
            caughtBlocks.add(new ArrayList<TryCatchBlock>());
            specialPhis.add(new ArrayList<Phi>());
        }
        for (int i = 0; i < program.basicBlockCount(); ++i) {
            for (TryCatchBlock tryCatch : program.basicBlockAt(i).getTryCatchBlocks()) {
                caughtBlocks.get(tryCatch.getHandler().getIndex()).add(tryCatch);
            }
        }
        boolean[] processed = new boolean[program.basicBlockCount()];
        while (head > 0) {
            Task task = stack[--head];
            currentBlock = task.block;
            if (processed[currentBlock.getIndex()]) {
                continue;
            }
            processed[currentBlock.getIndex()] = true;
            variableMap = Arrays.copyOf(task.variables, task.variables.length);
            for (Phi phi : currentBlock.getPhis()) {
                Variable var = program.createVariable();
                var.getDebugNames().addAll(phi.getReceiver().getDebugNames());
                variableMap[phi.getReceiver().getIndex()] = var;
                phi.setReceiver(var);
            }
            if (!caughtBlocks.get(currentBlock.getIndex()).isEmpty()) {
                Phi phi = new Phi();
                phi.setReceiver(program.createVariable());
                for (TryCatchBlock tryCatch : caughtBlocks.get(currentBlock.getIndex())) {
                    variableMap[tryCatch.getExceptionVariable().getIndex()] = phi.getReceiver();
                    Set<String> debugNames = tryCatch.getExceptionVariable().getDebugNames();
                    tryCatch.setExceptionVariable(program.createVariable());
                    tryCatch.getExceptionVariable().getDebugNames().addAll(debugNames);
                    Incoming incoming = new Incoming();
                    incoming.setSource(tryCatch.getProtectedBlock());
                    incoming.setValue(tryCatch.getExceptionVariable());
                    phi.getIncomings().add(incoming);
                }
                specialPhis.get(currentBlock.getIndex()).add(phi);
            }
            for (Instruction insn : currentBlock.getInstructions()) {
                variableDebugMap.putAll(variableDebugInfo.getDebugNames(insn));
                insn.acceptVisitor(consumer);
            }
            int[] successors = domGraph.outgoingEdges(currentBlock.getIndex());
            for (int i = 0; i < successors.length; ++i) {
                Task next = new Task();
                next.variables = Arrays.copyOf(variableMap, variableMap.length);
                next.block = program.basicBlockAt(successors[i]);
                stack[head++] = next;
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.