Class ComputePool
- Namespace
- Balsam.Optimization
- Assembly
- Balsam.Backtester.dll
Provides a pool of computing resources for strategy simulation.
public class ComputePool : IComputePool, IEnumerable<ComputeNode>, IEnumerable, IDisposable
- Inheritance
-
ComputePool
- Implements
- Inherited Members
- Extension Methods
Properties
Count
Gets the number of available compute nodes.
public int Count { get; }
Property Value
Local
Gets a compute pool with a single local compute node (thread).
public static ComputePool Local { get; }
Property Value
Methods
Add(ComputeNode)
Adds the specified compute node to the pool.
public void Add(ComputeNode node)
Parameters
node
ComputeNode
Create(int)
Creates a compute pool comprised of the specified number of local compute nodes (threads).
public static ComputePool Create(int instances)
Parameters
instances
int
Returns
Create(Type, int, params object[])
Creates and adds multiple instances to the compute pool.
public static ComputePool Create(Type type, int instances, params object[] arguments)
Parameters
Returns
Dispose()
Releases resources.
public void Dispose()
Dispose(bool)
Releases resources.
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
Get()
Gets the next available compute node.
public ComputeNode Get()
Returns
GetEnumerator()
Returns an enumerator to iterate through the collection.
public IEnumerator<ComputeNode> GetEnumerator()
Returns
GetStatus()
Prints the status of the pool nodes.
public void GetStatus()
Initialize()
Initializes the compute pool for use, setting the maximum number of concurrent nodes based on the current count.
public void Initialize()
Release(ComputeNode)
Returns the specified compute node back to the pool for reuse.
public void Release(ComputeNode node)
Parameters
node
ComputeNode
ToString()
Returns a string representation of this object.
public override string ToString()