Class NearestReproducibleInterpolator<T>
Implements a reproducible interpolator that selects the nearest value from a specified window.
Inherited Members
Namespace: Microsoft.Psi.Common.Interpolators
Assembly: Microsoft.Psi.dll
Syntax
public sealed class NearestReproducibleInterpolator<T> : ReproducibleInterpolator<T>
Type Parameters
Name | Description |
---|---|
T | The type of messages. |
Remarks
The interpolator results do not depend on the wall-clock time of the messages arriving on the secondary stream, i.e., they are based on originating times of messages. As a result, the interpolator might introduce an extra delay as it might have to wait for enough messages on the secondary stream to prove that the interpolation result is correct, irrespective of any other messages that might arrive later.
Constructors
View SourceNearestReproducibleInterpolator(RelativeTimeInterval, Boolean, T)
Initializes a new instance of the NearestReproducibleInterpolator<T> class.
Declaration
public NearestReproducibleInterpolator(RelativeTimeInterval relativeTimeInterval, bool orDefault, T defaultValue = null)
Parameters
Type | Name | Description |
---|---|---|
RelativeTimeInterval | relativeTimeInterval | The relative time interval within which to search for the first message. |
System.Boolean | orDefault | Indicates whether to output a default value when no result is found. |
T | defaultValue | An optional default value to use. |
Methods
View SourceInterpolate(DateTime, IEnumerable<Message<T>>, Nullable<DateTime>)
Interpolates a set of messages at a given time.
Declaration
public override InterpolationResult<T> Interpolate(DateTime interpolationTime, IEnumerable<Message<T>> messages, DateTime? closedOriginatingTime)
Parameters
Type | Name | Description |
---|---|---|
DateTime | interpolationTime | The time to interpolate. |
IEnumerable<Message<T>> | messages | |
System.Nullable<DateTime> | closedOriginatingTime | An optional date-time that, when present, indicates at what time the stream was closed. |
Returns
Type | Description |
---|---|
InterpolationResult<T> | An interpolation result InterpolationResult<T>. |
Overrides
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |