Real

A profile of LinearEquations; a piece-wise linear real-number profile.

Constructors

Link copied to clipboard
constructor(v: Number)
constructor(eq: LinearEquation)
constructor(vararg segments: Segment<LinearEquation>)
constructor(segments: List<Segment<LinearEquation>>)
constructor(timeline: Timeline<Segment<LinearEquation>, Real>)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class RealOpException(message: String) : Exception

An exception for linear profile operations; usually thrown in contexts that require one or more of the operands to be piecewise constant.

Functions

Link copied to clipboard
abstract fun abs(): Real

(DOC) Calculates the absolute value of this profile.

Link copied to clipboard
open infix fun assignGaps(other: SerialSegmentOps<LinearEquation, *>): Real

(DOC) Fills in gaps in this profile with another profile.

open infix fun assignGaps(v: LinearEquation): Real

(DOC) Fills in gaps in this profile with a constant value.

Link copied to clipboard
open override fun cache(): Real

(DOC) Caches the timeline for all available time.

open override fun cache(opts: CollectOptions): Real

Caches the result of collecting this timeline, to be reused for future collect requests if possible.

open override fun cache(bounds: Interval): Real

(DOC) A simplified version of cache.

Link copied to clipboard
open override fun changes(): Booleans

(DOC) Returns a Booleans that is true whenever this profile changes, and false or gap everywhere else.

Link copied to clipboard
open override fun collect(): List<Segment<LinearEquation>>

(DOC) Collects the timeline for all available time.

open override fun collect(opts: CollectOptions): List<Segment<LinearEquation>>

(DOC) Evaluates the stack of operations and produces a list of timeline payload objects.

open override fun collect(bounds: Interval): List<Segment<LinearEquation>>

(DOC) A simplified version of collect.

Link copied to clipboard

(DOC) Safely converts to another timeline type that accepts the same payload type.

Link copied to clipboard
open override fun decreases(): Booleans

(DOC) Returns a Booleans that is true whenever this profile decreases, and false or gap everywhere else.

Link copied to clipboard

(DOC) Uses a NullBinaryOperation as a predicate to highlight edges between segments.

Link copied to clipboard
operator fun div(other: SerialNumericOps<*, *>): Real

Calculates this divided by another numeric profile.

operator fun div(n: Number): Real

Calculates this divided by a constant number.

Link copied to clipboard
infix fun equalTo(other: SerialNumericOps<*, *>): Booleans

Returns a Booleans that is true when this and another numeric profile are equal.

infix fun equalTo(n: Number): Booleans

Returns a Booleans that is true when this equals a constant number.

Link copied to clipboard
open fun filter(preserveMargin: Boolean = false, f: (Segment<LinearEquation>) -> Boolean): Real

(DOC) Removes or retains objects based on a predicate.

Link copied to clipboard
open fun filterByDuration(validInterval: Interval): Real

(DOC) Removes objects whose duration is outside a given valid interval.

Link copied to clipboard
open fun filterByWindows(windows: SerialOps<Interval, *>, truncateMarginal: Boolean = true): Real

(DOC) Filters out payload objects whose intervals are not contained in the given Windows timeline.

Link copied to clipboard
open fun filterLongerThan(dur: Duration): Real

(DOC) Removes objects whose duration is shorter than a given duration.

Link copied to clipboard
open fun filterShorterThan(dur: Duration): Real

(DOC) Removes objects whose duration is longer than a given duration.

Link copied to clipboard

(DOC) Performs a local binary operation that produces profiles, and flattens it into a profile of the same type as this.

(DOC) Performs a local binary operation that produces profiles, and flattens it, with special treatment of gaps.

Link copied to clipboard

(DOC) A simpler version of flatMap2Values for operations that don't change the timeline type.

open fun <W : Any, R : Any, RESULT : SegmentOps<R, RESULT>> flatMap2Values(ctor: (Timeline<Segment<R>, RESULT>) -> RESULT, other: SegmentOps<W, *>, op: (LinearEquation, W, Interval) -> SegmentOps<R, *>?): RESULT

(DOC) Performs a local binary operation that produces profiles, and flattens it.

Link copied to clipboard

(DOC) A simpler version of flatMapValues for operations that don't change the timeline type.

(DOC) Maps segments into a collection of nested timelines and flattens them into their original intervals.

Link copied to clipboard
Link copied to clipboard
infix fun greaterThan(other: SerialNumericOps<*, *>): Booleans

Returns a Booleans that is true when this is greater than another numeric profile.

infix fun greaterThan(n: Number): Booleans

Returns a Booleans that is true when this is greater than a constant number.

Link copied to clipboard

Returns a Booleans that is true when this is greater than or equal to another numeric profile.

Returns a Booleans that is true when this is greater than or equal to a constant number.

Link copied to clipboard

(DOC) Similar to filter, but produces a coalesced Windows object that highlights everything that satisfies the predicate.

Link copied to clipboard

Highlights intervals where the value is equal to a specific value.

Link copied to clipboard
open override fun increases(): Booleans

(DOC) Returns a Booleans that is true whenever this profile increases, and false or gap everywhere else.

Link copied to clipboard

(DOC) Inserts a no-op function into the operation stack to allow side effects, such as printing.

Link copied to clipboard
open fun integrate(unit: Duration = Duration.SECOND): Real

(DOC) Calculates the integral of this profile, starting from zero.

Link copied to clipboard

(DOC) Similar to filter, but returns an Universal timeline.

Link copied to clipboard
open operator override fun iterator(): Iterator<Segment<LinearEquation>>
Link copied to clipboard
infix fun lessThan(other: SerialNumericOps<*, *>): Booleans

Returns a Booleans that is true when this is less than another numeric profile.

infix fun lessThan(n: Number): Booleans

Returns a Booleans that is true when this is less than a constant number.

Link copied to clipboard

Returns a Booleans that is true when this is less than or equal to another numeric profile.

Returns a Booleans that is true when this is less than or equal to a constant number.

Link copied to clipboard

(DOC) Performs a local binary operation between two profiles where the result is the same type as this profile.

(DOC) Performs a local binary operation between two profiles, with special treatment of gaps.

Link copied to clipboard

(DOC) A simplified version of map2Values for operations that don't change the timeline type.

open fun <W : Any, R : Any, RESULT : SegmentOps<R, RESULT>> map2Values(ctor: (Timeline<Segment<R>, RESULT>) -> RESULT, other: SegmentOps<W, *>, op: (LinearEquation, W, Interval) -> R?): RESULT

(DOC) Performs a local binary operation between two segment-valued timelines.

Link copied to clipboard

(DOC) Locally transforms the values of a profile without changing the intervals or profile type.

(DOC) Locally transforms the values of a profile without changing the intervals.

Link copied to clipboard
operator fun minus(other: SerialNumericOps<*, *>): Real

Subtracts another numeric profile from this.

operator fun minus(n: Number): Real

Subtracts a constant number from this.

Link copied to clipboard
abstract fun negate(): Real

(DOC) Negates this profile.

Link copied to clipboard
infix fun notEqualTo(other: SerialNumericOps<*, *>): Booleans

Returns a Booleans that is true when this and another numeric profile are not equal.

infix fun notEqualTo(n: Number): Booleans

Returns a Booleans that is true when this does not equal a constant number.

Link copied to clipboard
operator fun plus(other: SerialNumericOps<*, *>): Real

Adds this and another numeric profile.

operator fun plus(n: Number): Real

Adds a constant number to this.

Link copied to clipboard
infix fun pow(exp: SerialNumericOps<*, *>): Real

Calculates this raised to the power of another numeric profile.

infix fun pow(n: Number): Real

Calculates this raised to the power of a constant number.

Link copied to clipboard
open fun rate(unit: Duration = Duration.SECOND): Numbers<Double>

(DOC) Maps each segment into its derivative.

Link copied to clipboard
fun sample(time: Duration): Double?

Calculates the value of the profile at the given time.

Link copied to clipboard
open fun select(interval: Interval): Real

(DOC) Restricts the timeline to only be evaluated in the given interval.

Link copied to clipboard
open infix fun set(other: SerialSegmentOps<LinearEquation, *>): Real

(DOC) Overwrites this profile with another. Gaps in the argument profile will be filled in with this profile.

Link copied to clipboard
open fun shift(dur: Duration): Real

(DOC) Uniformly shifts the entire timeline in time (positive shifts toward the future).

Link copied to clipboard
open override fun shiftedDifference(range: Duration): Real

(DOC) Calculates the difference between this profile's value at range time in the future, and this profile at the present.

Link copied to clipboard
open fun split(f: (Segment<LinearEquation>) -> Int): Real

(DOC) Splits payload objects into a variable number of equally sized pieces.

Link copied to clipboard
Link copied to clipboard
operator fun times(other: SerialNumericOps<*, *>): Real

Multiplies this and another numeric profile.

operator fun times(n: Number): Real

Multiplies this by a constant number.

Link copied to clipboard
open override fun toNumbers(message: String?): Numbers<Double>

Converts this to a primitive number profile (i.e. Numbers), throwing an error if this is not piece-wise constant.

Link copied to clipboard
open override fun toReal(): Real

(DOC) Converts the profile to a linear profile, a.k.a. Real (no-op if it already was linear).

Link copied to clipboard

Returns a Booleans that is true whenever this discontinuously transitions between a specific pair of values, and false or gap everywhere else.

Link copied to clipboard
open operator fun unaryMinus(): Real
Link copied to clipboard

(DOC) UNSAFE! Casts this timeline type to another type without changing its contents.

Link copied to clipboard
open fun <R : IntervalLike<R>, RESULT : GeneralOps<R, RESULT>> unsafeFlatMap(ctor: (Timeline<R, RESULT>) -> RESULT, boundsTransformer: BoundsTransformer, truncate: Boolean, f: (Segment<LinearEquation>) -> Segment<GeneralOps<R, *>>): RESULT

(DOC) UNSAFE! Maps each object to a nested timeline and flattens all the timelines into one.

Link copied to clipboard
open fun unsafeMap(boundsTransformer: BoundsTransformer, truncate: Boolean, f: (Segment<LinearEquation>) -> Segment<LinearEquation>): Real

(DOC) UNSAFE! A simpler version of unsafeMap for operations that don't change the timeline type.

open fun <R : IntervalLike<R>, RESULT : GeneralOps<R, RESULT>> unsafeMap(ctor: (Timeline<R, RESULT>) -> RESULT, boundsTransformer: BoundsTransformer, truncate: Boolean, f: (Segment<LinearEquation>) -> R): RESULT

(DOC) UNSAFE! Maps each timeline object to another object, of potentially a different type, at potentially a different time.

Link copied to clipboard

Performs a generalized binary operation between this and another timeline.

Link copied to clipboard
open fun unsafeMapIntervals(boundsTransformer: BoundsTransformer, truncate: Boolean, f: (Segment<LinearEquation>) -> Interval): Real

(DOC) UNSAFE! Maps the interval of each object, leaving the rest of the object unchanged.

Link copied to clipboard

(DOC) UNSAFE! A simpler version of unsafeOperate for operations that don't change the timeline type.

(DOC) UNSAFE! The basic, most general operation method. All operations eventually delegate here.

Link copied to clipboard
open fun unset(reject: Interval): Real

(DOC) Unsets everything in a given interval. Timeline objects whose intervals fully contain the rejected interval may be split into two objects.

Link copied to clipboard
open infix fun zip(other: SerialSegmentOps<LinearEquation, *>): Real

Overlays two profiles on each other, asserting that they both cannot be defined at the same time.