TraceLoader

class TraceLoader @JvmOverloads constructor(path: String, cyclic: Boolean = false, normalizer: GPSTimeAlignment) : Iterable<GPSTrace>

Loads GPSTraces from the file or directory at path, aligns their time using normalizer, and makes them iterable, cyclically if cyclic is true.

Constructors

Link copied to clipboard
constructor(path: String, cyclic: Boolean = false, normalizer: GPSTimeAlignment)
constructor(path: String, cyclic: Boolean = false, timeNormalizerClass: String, vararg normalizerArgs: Any?)

Builds a new loader reading the traces at path and aligning their time with a GPSTimeAlignment created by class name (timeNormalizerClass) with the given normalizerArgs. If cyclic is true, the traces are iterated cyclically.

Properties

Link copied to clipboard
val size: Int?

Returns the number of loaded traces, or null if the traces are iterated cyclically.

Functions

Link copied to clipboard
open operator override fun iterator(): Iterator<GPSTrace>
Link copied to clipboard
fun <R> Iterable<R>.randomElement(randomGenerator: RandomGenerator): R

Returns a random element of the Iterable using the provided randomGenerator.

Link copied to clipboard
fun <R> Iterable<R>.shuffled(randomGenerator: RandomGenerator): Iterable<R>

Fisher–Yates shuffle algorithm using a RandomGenerator. More information on Wikipedia.