org.opentripplanner.transit.raptor.rangeraptor.standard.heuristics.HeuristicSearch Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.transit.raptor.rangeraptor.standard.heuristics;
import org.opentripplanner.transit.raptor.api.path.Path;
import org.opentripplanner.transit.raptor.api.transit.RaptorTripSchedule;
import org.opentripplanner.transit.raptor.api.view.Heuristics;
import org.opentripplanner.transit.raptor.api.view.Worker;
import java.util.Collection;
/**
* Combine Heuristics and Worker into one class to be able to retrieve the
* heuristics after the worker is invoked.
*
* @param The TripSchedule type defined by the user of the raptor API.
*/
public class HeuristicSearch implements Worker {
private final Worker worker;
private final Heuristics heuristics;
public HeuristicSearch(Worker worker, Heuristics heuristics) {
this.worker = worker;
this.heuristics = heuristics;
}
public Heuristics heuristics() {
return heuristics;
}
@Override
public Collection> route() {
return worker.route();
}
public boolean destinationReached() {
return heuristics.destinationReached();
}
}