Class NearestAvailableInterpolator<T>
Implements a greedy interpolator that selects the nearest value from a specified window. The interpolator only considers messages available in the window on the secondary stream at the moment the primary stream message arrives. As such, it belongs to the class of greedy interpolators and does not guarantee reproducible results.
Inherited Members
Namespace: Microsoft.Psi.Common.Interpolators
Assembly: Microsoft.Psi.dll
Syntax
public sealed class NearestAvailableInterpolator<T> : GreedyInterpolator<T>
Type Parameters
Name | Description |
---|---|
T | The type of messages. |
Constructors
View SourceNearestAvailableInterpolator(RelativeTimeInterval, Boolean, T)
Initializes a new instance of the NearestAvailableInterpolator<T> class.
Declaration
public NearestAvailableInterpolator(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 |