Package algo

Examples of algo.FlightDijkstra


    if (to == null) {
      statusLabel_.setText("Cannot perform query: missing destination");
      return;
    }

    FlightDijkstra alg = new FlightDijkstra();
   
    int time = (queryData_.getHour()%12) * 60 + queryData_.getMinute();
    if (queryData_.getAmpm() == QueryData.QD_PM) {
      time += 60*12;
    }

    time = StandardOps.toGMT(time, ((AirportSpecs)from.element()).GMToffset());

    alg.execute(dataSet_, from, to, time);

    try {
      queryData_.setPath(alg.reportPath());
      int t = alg.distance(to);
      statusLabel_.setText("Path of length " + ((t - (t%60))/60) + " hours " + (t%60) + " minutes found");
    } catch (InvalidQueryException iqe){
      statusLabel_.setText("No path exists between " + ((AirportSpecs)from.element()).code() +
         " and " + ((AirportSpecs)to.element()).code());
      queryData_.setFrom(null);
      queryData_.setTo(null);
    }

    alg.cleanup();
    updatePanel_.updatedQueryData();
  }
View Full Code Here

TOP

Related Classes of algo.FlightDijkstra

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.