Examples of DepthFirstSearch


Examples of aima.core.search.uninformed.DepthFirstSearch

    case GRAPH_SEARCH:
      qs = new GraphSearch();
    }
    switch (strategy) {
    case DF_SEARCH:
      result = new DepthFirstSearch(qs);
      break;
    case BF_SEARCH:
      result = new BreadthFirstSearch(qs);
      break;
    case ID_SEARCH:
View Full Code Here

Examples of aima.core.search.uninformed.DepthFirstSearch

    try {
      Problem problem = new Problem(new NQueensBoard(8),
          NQueensFunctionFactory.getIActionsFunction(),
          NQueensFunctionFactory.getResultFunction(),
          new NQueensGoalTest());
      Search search = new DepthFirstSearch(new GraphSearch());
      SearchAgent agent = new SearchAgent(problem, search);
      printActions(agent.getActions());
      printInstrumentation(agent.getInstrumentation());
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

Examples of aima.core.search.uninformed.DepthFirstSearch

  public void testDepthFirstSuccesfulSearch() throws Exception {
    Problem problem = new Problem(new NQueensBoard(8),
        NQueensFunctionFactory.getIActionsFunction(),
        NQueensFunctionFactory.getResultFunction(),
        new NQueensGoalTest());
    Search search = new DepthFirstSearch(new GraphSearch());
    SearchAgent agent = new SearchAgent(problem, search);
    List<Action> actions = agent.getActions();
    assertCorrectPlacement(actions);
    Assert.assertEquals("113",
        agent.getInstrumentation().getProperty("nodesExpanded"));
View Full Code Here

Examples of aima.core.search.uninformed.DepthFirstSearch

  public void testDepthFirstUnSuccessfulSearch() throws Exception {
    Problem problem = new Problem(new NQueensBoard(3),
        NQueensFunctionFactory.getIActionsFunction(),
        NQueensFunctionFactory.getResultFunction(),
        new NQueensGoalTest());
    Search search = new DepthFirstSearch(new GraphSearch());
    SearchAgent agent = new SearchAgent(problem, search);
    List<Action> actions = agent.getActions();
    Assert.assertEquals(0, actions.size());
    Assert.assertEquals("6",
        agent.getInstrumentation().getProperty("nodesExpanded"));
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.DepthFirstSearch

    @Override
    public ObligationDataflow analyze(IAnalysisCache analysisCache, MethodDescriptor methodDescriptor)
            throws CheckedAnalysisException {
        CFG cfg = analysisCache.getMethodAnalysis(CFG.class, methodDescriptor);
        DepthFirstSearch dfs = analysisCache.getMethodAnalysis(DepthFirstSearch.class, methodDescriptor);
        XMethod xmethod = XFactory.createXMethod(methodDescriptor);
        ConstantPoolGen cpg = analysisCache.getClassAnalysis(ConstantPoolGen.class, methodDescriptor.getClassDescriptor());

        ObligationPolicyDatabase database = analysisCache.getDatabase(ObligationPolicyDatabase.class);
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.DepthFirstSearch

     */
    @Override
    public ReturnPathTypeDataflow analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor)
            throws CheckedAnalysisException {
        CFG cfg = getCFG(analysisCache, descriptor);
        DepthFirstSearch dfs = getDepthFirstSearch(analysisCache, descriptor);
        ReverseDepthFirstSearch rdfs = getReverseDepthFirstSearch(analysisCache, descriptor);
        ReturnPathTypeAnalysis analysis = new ReturnPathTypeAnalysis(cfg, rdfs, dfs);
        ReturnPathTypeDataflow dataflow = new ReturnPathTypeDataflow(cfg, analysis);

        dataflow.execute();
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.DepthFirstSearch

        // If the CFG changed as a result of pruning, purge all analysis results
        // for the method.
        if (changed) {

            DepthFirstSearch dfs = new DepthFirstSearch(cfg);
            dfs.search();
            Collection<BasicBlock> unreachable = dfs.unvisitedVertices();
            if (!unreachable.isEmpty()) {
                if (DEBUG_CFG) {
                    System.out.println("Unreachable blocks");
                }
                for (BasicBlock b : unreachable) {
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.DepthFirstSearch

        MethodGen methodGen = getMethodGen(analysisCache, descriptor);
        if (methodGen == null) {
            throw new MethodUnprofitableException(descriptor);
        }

        DepthFirstSearch dfs = getDepthFirstSearch(analysisCache, descriptor);
        LoadedFieldSet loadedFieldSet = getLoadedFieldSet(analysisCache, descriptor);
        ValueNumberAnalysis analysis = new ValueNumberAnalysis(methodGen, dfs, loadedFieldSet, AnalysisContext
                .currentAnalysisContext().getLookupFailureCallback());
        analysis.setMergeTree(new MergeTree(analysis.getFactory()));
        CFG cfg = getCFG(analysisCache, descriptor);
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.DepthFirstSearch

     * .classfile.IAnalysisCache, java.lang.Object)
     */
    @Override
    public DominatorsAnalysis analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException {
        CFG cfg = getCFG(analysisCache, descriptor);
        DepthFirstSearch dfs = getDepthFirstSearch(analysisCache, descriptor);
        DominatorsAnalysis analysis = new DominatorsAnalysis(cfg, dfs, true);
        Dataflow<java.util.BitSet, DominatorsAnalysis> dataflow = new Dataflow<java.util.BitSet, DominatorsAnalysis>(cfg,
                analysis);
        dataflow.execute();
        return analysis;
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.DepthFirstSearch

     * .classfile.IAnalysisCache, java.lang.Object)
     */
    @Override
    public ReturnPathDataflow analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException {
        CFG cfg = getCFG(analysisCache, descriptor);
        DepthFirstSearch dfs = getDepthFirstSearch(analysisCache, descriptor);
        ReturnPathAnalysis analysis = new ReturnPathAnalysis(dfs);
        ReturnPathDataflow dataflow = new ReturnPathDataflow(cfg, analysis);
        dataflow.execute();
        return dataflow;
    }
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.