Examples of AStar


Examples of aStarLibrary.AStar

   */
  @SuppressWarnings("unchecked")
  @Override
  public void run() {
   
    AStar aStar = new AStar();
   
    aStar.nodes.addAll(this._map.getNodes());
   
    List<Node> nodes = aStar.getPath(this._from, this._to);
    List<Position> positions = this._map.nodesToPositions(nodes);
   
    this._listener.pathfindingFinished(positions);
  }
View Full Code Here

Examples of aStarLibrary.AStar

   
    if(from.getId() == to.getId())
      return result;
   
    // plan the path:
    AStar aStar = new AStar();
    aStar.nodes.addAll(this.getNodes());
   
    List<Node> nodes =
      aStar.getPath(
          ((BasePosition)from).getNode(),
          ((BasePosition)to).getNode()
      );
   
    // the a* algorithm returns the nodes in oposite order
View Full Code Here

Examples of cc.mallet.util.search.AStar

    int f = 0;
    for (int i = 0; i < t.numStates(); i++) {
      if (lattice[latticeLength-1][i] != null && lattice[latticeLength-1][i].delta > Transducer.IMPOSSIBLE_WEIGHT)
        finalNodes[f++] = lattice[latticeLength-1][i];
    }
    AStar search = new AStar(finalNodes, latticeLength * t.numStates());
    List<SequencePairAlignment<Object,ViterbiNode>> outputs = new ArrayList<SequencePairAlignment<Object,ViterbiNode>>(n);
    for (int i = 0; i < n && search.hasNext(); i++) {
      // gsc: removing unnecessary cast
      SearchNode ans = search.next();
      double weight = -ans.getCost();
      ViterbiNode[] seq = new ViterbiNode[latticeLength];
      // Commented out so we get the start state ViterbiNode -akm 12/2007
      //ans = ans.getParent(); // ans now corresponds to the Viterbi node after the first transition
      for (int j = 0; j < latticeLength; j++) {
View Full Code Here

Examples of org.neo4j.graphalgo.impl.path.AStar

     * using the A* algorithm.
     */
    public static PathFinder<WeightedPath> aStar( RelationshipExpander expander,
            CostEvaluator<Double> lengthEvaluator, EstimateEvaluator<Double> estimateEvaluator )
    {
        return new AStar( expander, lengthEvaluator, estimateEvaluator );
    }
View Full Code Here

Examples of rlforj.pathfinding.AStar

                endx = rand.nextInt(w); endy = rand.nextInt(h);
               
                if (!m.isObstacle(startx, starty) && !m.isObstacle(endx, endy))
                    break;
            }
            AStar algo = new AStar(m, w, h);
           
            Point2I[] path = algo.findPath(startx, starty, endx, endy);
            if (path != null)
            {
                // Check path
                for (Point2I step: path)
                {
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.