Table of Contents

Interface IProcess<TState, TInput, TOutput>

Namespace
Virtufin.Core.Behaviour
Assembly
Virtufin.Core.dll

Coalgebra shape for a stateful process: given the current state and an input observation, produce the next state and an output. The domain instantiations are IDecide<TState, TMarket, TPortfolio, TAction> (decide) and IExecutor (execute), where the process carries hidden state that must be exposed explicitly. Drive a process over an observable stream of inputs with Run<TState, TInput, TOutput>(IProcess<TState, TInput, TOutput>, IObservable<TInput>).

public interface IProcess<TState, TInput, TOutput>

Type Parameters

TState

The process's internal state.

TInput

The input observation.

TOutput

The output emitted at this step.

Extension Methods

Properties

Initial

The initial state.

TState Initial { get; }

Property Value

TState

Methods

Step(TState, TInput)

Step the process forward by one input observation.

(TState NextState, TOutput Output) Step(TState state, TInput input)

Parameters

state TState

Current state.

input TInput

Observation to apply.

Returns

(TState NextState, TOutput Output)

Tuple of (next state, output emitted).