Continuous

class Continuous<A>(vectorSpace: Lazy<VectorSpace<A>>, f: (Duration) -> A) : Behavior<A> (source)

A generic continuous function of time.

Constructors

Link copied to clipboard
constructor(vectorSpace: Lazy<VectorSpace<A>>, f: (Duration) -> A)

Properties

Link copied to clipboard
open override val parentBehaviors: List<BehaviorID>

Functions

Link copied to clipboard
open fun <B> flatMap(f: SampleScope.(A) -> Behavior<B>): Behavior<B>
Link copied to clipboard
inline fun <T> Behavior<T>.integrate(initial: T? = null): Behavior<T>

Integrate the behavior with respect to the current Timeline's clock time.

fun <T> Behavior<T>.integrate(vectorSpace: VectorSpace<T>, initial: T? = null): Behavior<T>

Integrate the behavior with respect to the current Timeline's clock time, supplying an explicit VectorSpace instance.

Link copied to clipboard
inline fun <T> Behavior<T>.integrateWith(initial: T, noinline accum: SampleScope.(T, T) -> T): Behavior<T>
fun <T> Behavior<T>.integrateWith(vectorSpace: VectorSpace<T>, initial: T, accum: SampleScope.(T, T) -> T): Behavior<T>
Link copied to clipboard
open fun <B> map(f: SampleScope.(A) -> B): Behavior<B>
Link copied to clipboard
open override fun measureImpulses(time: Duration, dt: Duration): A

Used to support dirac impulses in behaviors.

Link copied to clipboard
operator fun Behavior<Boolean>.not(): Behavior<Boolean>

Negate the value of the behavior at all times.

Link copied to clipboard
@JvmName(name = "plusFloat2")
operator fun Behavior<Float2>.plus(other: Behavior<Float2>): Behavior<Float2>
@JvmName(name = "plusFloat3")
operator fun Behavior<Float3>.plus(other: Behavior<Float3>): Behavior<Float3>
@JvmName(name = "plusDouble")
operator fun Behavior<Double>.plus(other: Behavior<Double>): Behavior<Double>
@JvmName(name = "plusFloat")
operator fun Behavior<Float>.plus(other: Behavior<Float>): Behavior<Float>
@JvmName(name = "plusInt")
operator fun Behavior<Int>.plus(other: Behavior<Int>): Behavior<Int>
Link copied to clipboard
open fun sample(times: Event<Any?> = Timeline.currentTimeline().clock): Event<A>

Sample a Behavior at the occurrences of times, returning a new Event with the values of the behavior at those times.

Link copied to clipboard
open fun sampleState(times: Event<Any?> = Timeline.currentTimeline().timeBehavior.updated()): Signal<A>

Sample a Behavior to produce a Signal.

Link copied to clipboard
open override fun sampleValueAt(time: Duration): A

Calculates the value at the specified time.

Link copied to clipboard
open fun transformTime(transform: (Duration) -> Duration): Behavior<A>

Apply a function to the time used to sample the behavior.

Link copied to clipboard
open fun until(event: Event<Behavior<A>>): Behavior<A>

Constructs a new behavior whose values are equal to those of this behavior up until event is fired, at which point the behavior's value will switch to match the values of the event's inner behavior.