Class DistanceTravelledCalculator


  • public class DistanceTravelledCalculator
    extends java.lang.Object
    • Method Detail

      • calculateDistanceByCellFromFiles

        public rx.Observable<CellAndDistance> calculateDistanceByCellFromFiles​(rx.Observable<java.io.File> files)
        Returns distinct cells and the the total nautical miles travelled in that cell. Uses RxJava Observables to maximize throughput and will scale to use all available processors and to handle a large number of files (number of open file handles should be limited by number of available processors).
        Parameters:
        files -
        Returns:
      • calculateDensityByCellFromFiles

        public static rx.Observable<CellValue> calculateDensityByCellFromFiles​(Options options,
                                                                               rx.Observable<java.io.File> files,
                                                                               int horizontal,
                                                                               int vertical,
                                                                               DistanceCalculationMetrics metrics)
      • partition

        public static rx.Observable<Options> partition​(Options options,
                                                       int horizontal,
                                                       int vertical)
        Returns a sequence of Options that are same as the source apart from the Bounds which are partitioned according to horizontal and vertical parameters. For map-reduce purposes we need to be able to partition the bounds of Options. Passing horizontal=1 and vertical=1 will return one item only being a copy of the source Options.
        Parameters:
        options -
        horizontal - number of regions (with longitude)
        vertical - number of regions (with latitude)
        Returns: