totalTime = "PT1M";
return totalTime;
}
private RouteTotals getTotals(SegmentDescription[] segmentDescription, RouteProximityOptions ro, RouteStop[] rs, double gTotalToolFeeCost) {
RouteTotals rt = new RouteTotals();
double distance;
distance = 0;
try {
distance = segmentDescription[segmentDescription.length - 1].getCumulativeDistance();
// Total com ped�gios
rt.setTotaltollFeeCost(Functions.formatDouble(gTotalToolFeeCost, "0.00"));
// dist�ncia total
rt.setTotalDistance(Functions.formatDouble(distance, "0.00"));
// calcula o tempo total da viagem
rt.setTotalTime(getTotalTime(rt.getTotalDistance(), ro.getVehicle().getAverageSpeed()));
// calcula o total do combust�vel gasto na viagem
if (ro.getVehicle().getAverageConsumption() > 0)
rt.setTotalFuelUsed(Functions.formatDouble((rt.getTotalDistance() / ro.getVehicle().getAverageConsumption()), "0.00"));
// calcula o valor total gasto com combust�vel na viagem
rt.setTotalfuelCost(Functions.formatDouble((rt.getTotalFuelUsed() * ro.getVehicle().getFuelPrice()), "0.00"));
// calcula o valor total gasto na viagem
rt.setTotalCost(Functions.formatDouble((gTotalToolFeeCost + rt.getTotalfuelCost()), "0.00"));
// Calcula o valor de tarifas de taxi
double[] TaxiFare = getTaxiFare(rt, rs);
rt.setTaxiFare1(TaxiFare[0]);
rt.setTaxiFare2(TaxiFare[1]);
} catch (Exception ex) {
// throw (ex);
}
return rt;