gitare 0 ارسال شده در ۲۴ دی ۱۳۹۳ گزارش اشتراک گذاری ارسال شده در ۲۴ دی ۱۳۹۳ سلام من دنبال الگوریتم مسیریابی سخن گو به زبان فارسی هستم یه نرم افزاری شبیه به Navitel Navigator و یه سری قابلیت های دیگه است برای پروژه یکی از دروسم لازم دارم اگر کسی میتونه کمکم کنه یا این پروژه رو انجام میده خبر بده. ممنون نقل قول لینک ارسال به اشتراک گذاری در سایت های دیگر
Farzad Sarseifi 575 ارسال شده در ۲۴ دی ۱۳۹۳ گزارش اشتراک گذاری ارسال شده در ۲۴ دی ۱۳۹۳ میتوانید با الگوریتم Dijestra که کوتاهترین مسیر را انتخاب کنید اینکار را پیاده سازی کنید https://play.google.com/store/apps/details?id=com.navitel&hl=en نقل قول لینک ارسال به اشتراک گذاری در سایت های دیگر
gitare 0 ارسال شده در ۲۴ دی ۱۳۹۳ مالک گزارش اشتراک گذاری ارسال شده در ۲۴ دی ۱۳۹۳ میتوانید با الگوریتم Dijestra که کوتاهترین مسیر را انتخاب کنید اینکار را پیاده سازی کنید https://play.google.com/store/apps/details?id=com.navitel&hl=en ممنون از کمکتون ولی لینکی که گفتین باز نمیشه نقل قول لینک ارسال به اشتراک گذاری در سایت های دیگر
Farzad Sarseifi 575 ارسال شده در ۲۴ دی ۱۳۹۳ گزارش اشتراک گذاری ارسال شده در ۲۴ دی ۱۳۹۳ کد الگوریتم Dijestra : [shcode=java] public class Dijkstra { private final List nodes; private final List edges; private Set unSettledNodes; private Set settledNodes; private Map predecessors; private Map distance; private Context context; private StationsDBAdapter stationsDBAdapter; public Dijkstra(Graph graph, Context c) { // Create a copy of the array so that we can operate on this array this.nodes = new ArrayList(graph.getVertexes()); this.edges = new ArrayList(graph.getEdges()); this.context = c; this.stationsDBAdapter = new StationsDBAdapter(this.context); } public void execute(Station source) { settledNodes = new HashSet(); unSettledNodes = new HashSet(); distance = new HashMap(); predecessors = new HashMap(); distance.put(source, 0); unSettledNodes.add(source); while (unSettledNodes.size() > 0) { Station node = getMinimum(unSettledNodes); settledNodes.add(node); unSettledNodes.remove(node); findMinimalDistances(node); } } public void execute(int source) { settledNodes = new HashSet(); unSettledNodes = new HashSet(); distance = new HashMap(); predecessors = new HashMap(); distance.put(getSrc(source), 0); unSettledNodes.add(getSrc(source)); while (unSettledNodes.size() > 0) { Station node = getMinimum(unSettledNodes); settledNodes.add(node); unSettledNodes.remove(node); findMinimalDistances(node); } } private Station getMinimum(Set vertexes) { Station minimum = null; for (Station vertex : vertexes) { if (minimum == null) { minimum = vertex; } else { if (getShortestDistance(vertex) < getShortestDistance(minimum)) { minimum = vertex; } } } return minimum; } private void findMinimalDistances(Station node) { List adjacentNodes = getNeighbors(node); for (Station target : adjacentNodes) { if (getShortestDistance(target) > getShortestDistance(node) + getDistance(node, target)) { distance.put(target, getShortestDistance(node) + getDistance(node, target)); predecessors.put(target, node); unSettledNodes.add(target); } } } private int getShortestDistance(Station destination) { Integer d = distance.get(destination); if (d == null) { return Integer.MAX_VALUE; } else { return d; } } private List getNeighbors(Station node) { List neighbors = new ArrayList(); for (Edge edge : edges) { if (edge.getSource().equals(node) && !isSettled(this.getDest(edge))) { neighbors.add(this.getDest(edge)); } } return neighbors; } private int getDistance(Station node, Station target) { for (Edge edge : edges) { if (edge.getSource().equals(node) && edge.getDestination().equals(target)) { return edge.getWeight(); } } throw new RuntimeException("Should not happen"); } private boolean isSettled(Station vertex) { return settledNodes.contains(vertex); } private Station getDest(Edge edge) { Station station = new Station(); station = this.stationsDBAdapter.getStationDetails(edge .getDestinationID()); return station; } private Station getSrc(int id) { Station station = new Station(); station = this.stationsDBAdapter.getStationDetails(id); return station; } /* * This method returns the path from the source to the selected target and * NULL if no path exists */ public LinkedList getPath(Station target) { LinkedList path = new LinkedList(); Station step = target; // Check if a path exists if (predecessors.get(step) == null) { return null; } path.add(step); while (predecessors.get(step) != null) { step = predecessors.get(step); path.add(step); } // Put it into the correct order Collections.reverse(path); return path; } public LinkedList getPath(int target) { LinkedList path = new LinkedList(); Station step = this.getSrc(target); // Check if a path exists if (predecessors.get(step) == null) { return null; } path.add(step); while (predecessors.get(step) != null) { step = predecessors.get(step); path.add(step); } // Put it into the correct order Collections.reverse(path); return path; } } [/shcode] نقل قول لینک ارسال به اشتراک گذاری در سایت های دیگر
gitare 0 ارسال شده در ۲۶ دی ۱۳۹۳ مالک گزارش اشتراک گذاری ارسال شده در ۲۶ دی ۱۳۹۳ کد الگوریتم Dijestra : [shcode=java] public class Dijkstra { private final List nodes; private final List edges; private Set unSettledNodes; private Set settledNodes; private Map predecessors; private Map distance; private Context context; private StationsDBAdapter stationsDBAdapter; public Dijkstra(Graph graph, Context c) { // Create a copy of the array so that we can operate on this array this.nodes = new ArrayList(graph.getVertexes()); this.edges = new ArrayList(graph.getEdges()); this.context = c; this.stationsDBAdapter = new StationsDBAdapter(this.context); } public void execute(Station source) { settledNodes = new HashSet(); unSettledNodes = new HashSet(); distance = new HashMap(); predecessors = new HashMap(); distance.put(source, 0); unSettledNodes.add(source); while (unSettledNodes.size() > 0) { Station node = getMinimum(unSettledNodes); settledNodes.add(node); unSettledNodes.remove(node); findMinimalDistances(node); } } public void execute(int source) { settledNodes = new HashSet(); unSettledNodes = new HashSet(); distance = new HashMap(); predecessors = new HashMap(); distance.put(getSrc(source), 0); unSettledNodes.add(getSrc(source)); while (unSettledNodes.size() > 0) { Station node = getMinimum(unSettledNodes); settledNodes.add(node); unSettledNodes.remove(node); findMinimalDistances(node); } } private Station getMinimum(Set vertexes) { Station minimum = null; for (Station vertex : vertexes) { if (minimum == null) { minimum = vertex; } else { if (getShortestDistance(vertex) < getShortestDistance(minimum)) { minimum = vertex; } } } return minimum; } private void findMinimalDistances(Station node) { List adjacentNodes = getNeighbors(node); for (Station target : adjacentNodes) { if (getShortestDistance(target) > getShortestDistance(node) + getDistance(node, target)) { distance.put(target, getShortestDistance(node) + getDistance(node, target)); predecessors.put(target, node); unSettledNodes.add(target); } } } private int getShortestDistance(Station destination) { Integer d = distance.get(destination); if (d == null) { return Integer.MAX_VALUE; } else { return d; } } private List getNeighbors(Station node) { List neighbors = new ArrayList(); for (Edge edge : edges) { if (edge.getSource().equals(node) && !isSettled(this.getDest(edge))) { neighbors.add(this.getDest(edge)); } } return neighbors; } private int getDistance(Station node, Station target) { for (Edge edge : edges) { if (edge.getSource().equals(node) && edge.getDestination().equals(target)) { return edge.getWeight(); } } throw new RuntimeException("Should not happen"); } private boolean isSettled(Station vertex) { return settledNodes.contains(vertex); } private Station getDest(Edge edge) { Station station = new Station(); station = this.stationsDBAdapter.getStationDetails(edge .getDestinationID()); return station; } private Station getSrc(int id) { Station station = new Station(); station = this.stationsDBAdapter.getStationDetails(id); return station; } /* * This method returns the path from the source to the selected target and * NULL if no path exists */ public LinkedList getPath(Station target) { LinkedList path = new LinkedList(); Station step = target; // Check if a path exists if (predecessors.get(step) == null) { return null; } path.add(step); while (predecessors.get(step) != null) { step = predecessors.get(step); path.add(step); } // Put it into the correct order Collections.reverse(path); return path; } public LinkedList getPath(int target) { LinkedList path = new LinkedList(); Station step = this.getSrc(target); // Check if a path exists if (predecessors.get(step) == null) { return null; } path.add(step); while (predecessors.get(step) != null) { step = predecessors.get(step); path.add(step); } // Put it into the correct order Collections.reverse(path); return path; } } [/shcode] سلام خسته نباشید از سایت بسیار خوبتون خیلی ممنونم من دنبال یه کدی هستم که بتونه فرد را به مکان مورد نظرش به صورت سخن گو راهنمایی و جهت یابی کند (به اینصورت که بعد از شناسایی موقعیت فعلی کاربر با استفاده از GPS گوشیش موقعیت مورد نظرش را از طریق نقشه گوگل پیدا کند و به فرد اعلام کند) آیا این کار با نرم افزار SDK انجام می شود؟ اگر کسی می دونه کمکم کنه و منو راهنمایی کنه نقل قول لینک ارسال به اشتراک گذاری در سایت های دیگر
پست های پیشنهاد شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .