Examples of Pathable


Examples of com.googlecode.richrest.server.action.Pathable

      throws IOException {
    Serializable result = serializer.deserialize(Serializable.class, request);
    String path;
    Action<Serializable, Serializable> action = ActionContext.getContext().getAction();
    if (action instanceof Pageable) {
      Pathable pathAction = (Pathable)action;
      path = pathAction.getPath();
    } else {
      path = getPath(action);
    }
    return deserializePath(request, result, path);
  }
View Full Code Here

Examples of de.zelosfan.framework.Algorithms.Pathable

        openList.add(start);

        while (openList.size() != 0) {

            Pathable current = openList.getFirst();
            int lowestscore = f_score.get(openList.getFirst());
            for (Pathable node : openList) {
                if (f_score.get(node) < lowestscore) {
                    current = node;
                    lowestscore = f_score.get(node);
                }
            }

            openList.remove(current);
            closedList.add(current);

            for (int i = -1; i <= 1; i++) {
                for (int l = -1; l <= 1; l++) {
                    if (current.getPositionV2().x + i < nodes.length && current.getPositionV2().y + l < nodes[0].length && current.getPositionV2().x + i >= 0 && current.getPositionV2().y + l >= 0) {
                        if (current.isWalkable(current.equals(start))) {
                            if (Math.abs(i) != Math.abs(l)) {
                                Pathable neighbor = nodes[((int) current.getPositionV2().x + i)][((int) current.getPositionV2().y + l)];
                                int additionalResistance = neighbor.getWaycost();
                                int tentative_g_score = g_score.get(current) + additionalResistance;
                                if (closedList.contains(neighbor) && tentative_g_score >= g_score.get(neighbor)) {
                                    continue;
                                }
View Full Code Here

Examples of de.zelosfan.framework.Algorithms.Pathable

        openList.add(start);
        accessable.add(start);

        while (openList.size() != 0) {

            Pathable current = openList.getFirst();
            int lowestscore = f_score.get(openList.getFirst());
            for (Pathable node : openList) {
                if (f_score.get(node) < lowestscore) {
                    current = node;
                    lowestscore = f_score.get(node);
                }
            }

            openList.remove(current);
            closedList.add(current);

            for (int i = -1; i <= 1; i++) {
                for (int l = -1; l <= 1; l++) {
                    if (current.getPositionV2().x + i < nodes.length && current.getPositionV2().y + l < nodes[0].length && current.getPositionV2().x + i >= 0 && current.getPositionV2().y + l >= 0) {
                        if (current.isWalkable(current.equals(start))) {
                            if (Math.abs(i) != Math.abs(l)) {
                                Pathable neighbor = nodes[((int) current.getPositionV2().x + i)][((int) current.getPositionV2().y + l)];
                                int additionalResistance = 1;
                                int tentative_g_score = g_score.get(current) + additionalResistance;
                                if (closedList.contains(neighbor) && tentative_g_score >= g_score.get(neighbor)) {
                                    continue;
                                }
View Full Code Here

Examples of de.zelosfan.framework.Algorithms.Pathable

        openList.add(start);

        while (openList.size() != 0) {

            Pathable current = openList.getFirst();
            int lowestscore = f_score.get(openList.getFirst());
            for (Pathable node : openList) {
                if (f_score.get(node) < lowestscore) {
                    current = node;
                    lowestscore = f_score.get(node);
                }
            }


            if (current.equals(goal)) {
                return reconstructPath(came_from, goal);
            }

            openList.remove(current);
            closedList.add(current);

            for (int i = -1; i <= 1; i++) {
                for (int l = -1; l <= 1; l++) {
                    if (current.getPositionV2().x + i < nodes.length && current.getPositionV2().y + l < nodes[0].length && current.getPositionV2().x + i >= 0 && current.getPositionV2().y + l >= 0) {
                        if (current.isWalkable(current.equals(start))) {
                            if (Math.abs(i) != Math.abs(l) || allowVertical) {
                                Pathable neighbor = nodes[((int) current.getPositionV2().x + i)][((int) current.getPositionV2().y + l)];
                                //    int additionalResistance = Main.world.getTile((int) neighbor.x,(int) neighbor.y).getAdditionWaycost();
                                int additionalResistance = neighbor.getWaycost();

                                int heuristic;
                                if (allowVertical) {
                                    heuristic = (int) ( Math.abs(neighbor.getPositionV2().dst(goal.getPositionV2()) * standardWaycost));
                                } else {
                                    heuristic = (int) (( Math.abs(neighbor.getPositionV2().x - goal.getPositionV2().x) + Math.abs(neighbor.getPositionV2().y - goal.getPositionV2().y)) * standardWaycost);
                                }

                                int tentative_g_score = g_score.get(current) + additionalResistance;


View Full Code Here

Examples of de.zelosfan.framework.Algorithms.Pathable

        openList.add(start);

        while (openList.size() != 0) {

            Pathable current = openList.getFirst();
            int lowestscore = f_score.get(openList.getFirst());
            for (Pathable node : openList) {
                if (f_score.get(node) < lowestscore) {
                    current = node;
                    lowestscore = f_score.get(node);
                }
            }


            if (current.equals(goal)) {
                return AStarCus.reconstructPath(came_from, goal);
            }

            openList.remove(current);
            closedList.add(current);

            for (int i = -1; i <= 1; i++) {
                for (int l = -1; l <= 1; l++) {
                    if (current.getPositionV2().x + i < nodes.length && current.getPositionV2().y + l < nodes[0].length && current.getPositionV2().x + i >= 0 && current.getPositionV2().y + l >= 0) {
                        if (current.isWalkable(current.equals(start))) {
                            if (Math.abs(i) != Math.abs(l)) {
                                Tile neighbor = nodes[((int) current.getPositionV2().x + i)][((int) current.getPositionV2().y + l)];
                                int additionalResistance = Main.game.world.getIntelligentWaycost(neighbor, entity);

                                int tentative_g_score = g_score.get(current) + additionalResistance;

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.