Package org.encog.ml.graph

Examples of org.encog.ml.graph.BasicPath


  public AbstractGraphSearch(BasicGraph theGraph, BasicNode startingPoint, SearchGoal theGoal)
  {
    this.graph = theGraph;
    this.goal = theGoal;
    frontier.add(new BasicPath(startingPoint));
  }
View Full Code Here


         
      if( this.frontier.size()==0 ) {
        throw new EncogError("Frontier is empty, cannot find solution.");
      }
     
      BasicPath path = this.frontier.pop();

      if (this.goal.isGoalMet(path)) {
        this.solution = path;
        return;
      }

      BasicNode state = path.getDestinationNode();
      this.explored.add(state);
     
      for (BasicEdge connection : state.getConnections()) {
        if( !this.explored.contains(connection.getTo()) &&
          !this.frontier.containsDestination(connection.getTo())) {
          BasicPath path2 = new BasicPath(path, connection.getTo());
          this.frontier.add(path2);
        }
      }
    }
  }
View Full Code Here

 
  public BasicPath pop() {
    if( contents.size()==0 )
      return null;
   
    BasicPath result = contents.get(0);
    contents.remove(0);
    return result;
  }
View Full Code Here

TOP

Related Classes of org.encog.ml.graph.BasicPath

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.