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
Cores
Gets the number of processor cores.
public int Cores { get; protected set; }
Property Value
Errors
Gets the numer of simulation errors encountered.
public int Errors { get; }
Property Value
Host
Gets the name or ip address of the host.
public string Host { get; protected set; }
Property Value
IsRemote
Gets whether this compute node is remote.
public abstract bool IsRemote { get; }
Property Value
LastError
Gets the last error message.
public string LastError { get; }
Property Value
Name
Gets/sets the name of this compute node.
public string Name { get; set; }
Property Value
Runs
Gets the number of simulation runs.
public int Runs { get; protected set; }
Property Value
State
Gets the status.
public NodeState State { get; protected set; }
Property Value
Methods
GetNodeInfo()
Gets server status.
public abstract NodeInfo GetNodeInfo()
Returns
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
TypestrategyProperties
VariableDictionarymoneyManager
TypemoneyManagerProperties
VariableDictionaryoptimizer
TypeoptimizerProperties
VariableDictionarydata
objecttoken
CancellationToken
Returns
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
TypestrategyProperties
VariableDictionarydata
object
Returns
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
TypestrategyProperties
VariableDictionarymoneyManager
TypemoneyManagerProperties
VariableDictionarydata
object
Returns
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
TypestrategyProperties
VariableDictionarymoneyManager
TypemoneyManagerProperties
VariableDictionarydata
objecttoken
CancellationToken
Returns
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
TypestrategyProperties
VariableDictionarymoneyManager
TypemoneyManagerProperties
VariableDictionaryoptimizer
TypeoptimizerProperties
VariableDictionarydata
objecttoken
CancellationToken
Returns
Events
PropertyChanged
Raised when a property is changed.
public event PropertyChangedEventHandler PropertyChanged