InterpolationStrategy

class InterpolationStrategy(    locations: List<GeoLocation>,     broadcastDelay: Duration = BROADCAST_DELAY,     startDelay: Duration = START_DELAY,     currentSpeedInMetersPerSecond: Double = SPEED_METERS_PER_SECOND) : SimulationStrategy

Strategy that uses interpolation to determine position. Emits first location and starts emission of other locations after startDelay. Continuously emits rest of locations with a broadcastDelay.

Important: This is a Public Preview API. It may be changed or removed at any time.

Parameters

locations

List of locations to be emitted.

startDelay

Delay before second location is emitted.

broadcastDelay

Delay before emission of consecutive locations.

Constructors

Link copied to clipboard
fun InterpolationStrategy(    locations: List<GeoLocation>,     broadcastDelay: Duration = BROADCAST_DELAY,     startDelay: Duration = START_DELAY,     currentSpeedInMetersPerSecond: Double = SPEED_METERS_PER_SECOND)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun calculateLocation(): SimulationLocation

Calculates a SimulationLocation to broadcast as a location update.

Link copied to clipboard
fun changeCurrentSpeed(speedInMetersPerSecond: Double)

Changes current speed that will be used to calculate distance increment.

Link copied to clipboard
open override fun hasNext(): Boolean

Returns true if the geometry has more elements.