Table of Contents

Class ComputeNode

Namespace
Balsam.Optimization
Assembly
Balsam.Backtester.dll

Provides common functionality for compute nodes.

public abstract class ComputeNode : INotifyPropertyChanged
Inheritance
ComputeNode
Implements
Derived
Inherited Members
Extension Methods

Properties

AvgRuntime

Gets the average simulation compute time.

public TimeSpan AvgRuntime { get; }

Property Value

TimeSpan

Cores

Gets the number of processor cores.

public int Cores { get; protected set; }

Property Value

int

Errors

Gets the numer of simulation errors encountered.

public int Errors { get; }

Property Value

int

Host

Gets the name or ip address of the host.

public string Host { get; protected set; }

Property Value

string

IsRemote

Gets whether this compute node is remote.

public abstract bool IsRemote { get; }

Property Value

bool

LastError

Gets the last error message.

public string LastError { get; }

Property Value

string

Name

Gets/sets the name of this compute node.

public string Name { get; set; }

Property Value

string

Runs

Gets the number of simulation runs.

public int Runs { get; protected set; }

Property Value

int

State

Gets the status.

public NodeState State { get; protected set; }

Property Value

NodeState

Methods

GetNodeInfo()

Gets server status.

public abstract NodeInfo GetNodeInfo()

Returns

NodeInfo

OnError(string)

Called when there is an error.

protected virtual void OnError(string message)

Parameters

message string

OnPropertyChanged(string)

Called when a property changes.

protected virtual void OnPropertyChanged(string propertyName = null)

Parameters

propertyName string

OnRunSimulation(Type, VariableDictionary, Type, VariableDictionary, Type, VariableDictionary, object, CancellationToken)

Runs the simulation.

protected abstract SimulationResult OnRunSimulation(Type strategy, VariableDictionary strategyProperties, Type moneyManager, VariableDictionary moneyManagerProperties, Type optimizer, VariableDictionary optimizerProperties, object data, CancellationToken token)

Parameters

strategy Type
strategyProperties VariableDictionary
moneyManager Type
moneyManagerProperties VariableDictionary
optimizer Type
optimizerProperties VariableDictionary
data object
token CancellationToken

Returns

SimulationResult

Reconnect()

Used to reinitialize a node in case of connectivity issues.

public virtual void Reconnect()

RunSimulation(Type, VariableDictionary, object)

Runs a strategy simulation without money management.

public SimulationResult RunSimulation(Type strategy, VariableDictionary strategyProperties, object data)

Parameters

strategy Type
strategyProperties VariableDictionary
data object

Returns

SimulationResult

RunSimulation(Type, VariableDictionary, Type, VariableDictionary, object)

Runs a simulation with a money manager.

public SimulationResult RunSimulation(Type strategy, VariableDictionary strategyProperties, Type moneyManager, VariableDictionary moneyManagerProperties, object data)

Parameters

strategy Type
strategyProperties VariableDictionary
moneyManager Type
moneyManagerProperties VariableDictionary
data object

Returns

SimulationResult

RunSimulation(Type, VariableDictionary, Type, VariableDictionary, object, CancellationToken)

Runs a simulation using the specified parameters.

public SimulationResult RunSimulation(Type strategy, VariableDictionary strategyProperties, Type moneyManager, VariableDictionary moneyManagerProperties, object data, CancellationToken token)

Parameters

strategy Type
strategyProperties VariableDictionary
moneyManager Type
moneyManagerProperties VariableDictionary
data object
token CancellationToken

Returns

SimulationResult

RunSimulation(Type, VariableDictionary, Type, VariableDictionary, Type, VariableDictionary, object, CancellationToken)

Runs a simulation using the specified parameters.

public SimulationResult RunSimulation(Type strategy, VariableDictionary strategyProperties, Type moneyManager, VariableDictionary moneyManagerProperties, Type optimizer, VariableDictionary optimizerProperties, object data, CancellationToken token)

Parameters

strategy Type
strategyProperties VariableDictionary
moneyManager Type
moneyManagerProperties VariableDictionary
optimizer Type
optimizerProperties VariableDictionary
data object
token CancellationToken

Returns

SimulationResult

Events

PropertyChanged

Raised when a property is changed.

public event PropertyChangedEventHandler PropertyChanged

Event Type

PropertyChangedEventHandler