Lean
$LEAN_TAG$
|
Provides an implementation of IIsolatorLimitResultProvider that tracks the algorithm manager's time loops and enforces a maximum amount of time that each time loop may take to execute. The isolator uses the result provided by IsWithinLimit to determine if it should terminate the algorithm for violation of the imposed limits. More...
Public Member Functions | |
AlgorithmTimeLimitManager (ITokenBucket additionalTimeBucket, TimeSpan timeLoopMaximum) | |
Initializes a new instance of AlgorithmTimeLimitManager to manage the creation of IsolatorLimitResult instances as it pertains to the algorithm manager's time loop More... | |
void | StartNewTimeStep () |
Invoked by the algorithm at the start of each time loop. This resets the current time step elapsed time. More... | |
IsolatorLimitResult | IsWithinLimit () |
Determines whether or not the algorithm time loop is considered within the limits More... | |
void | RequestAdditionalTime (int minutes) |
Requests additional time to continue executing the current time step. At time of writing, this is intended to be used to provide training scheduled events additional time to allow complex training models time to execute while also preventing abuse by enforcing certain control parameters set via the job packet. More... | |
bool | TryRequestAdditionalTime (int minutes) |
Attempts to requests additional time to continue executing the current time step. At time of writing, this is intended to be used to provide training scheduled events additional time to allow complex training models time to execute while also preventing abuse by enforcing certain control parameters set via the job packet. More... | |
Properties | |
ITokenBucket | AdditionalTimeBucket [get] |
Gets the additional time bucket which is responsible for tracking additional time requested for processing via long-running scheduled events. In LEAN, we use the LeakyBucket More... | |
Provides an implementation of IIsolatorLimitResultProvider that tracks the algorithm manager's time loops and enforces a maximum amount of time that each time loop may take to execute. The isolator uses the result provided by IsWithinLimit to determine if it should terminate the algorithm for violation of the imposed limits.
Definition at line 30 of file AlgorithmTimeLimitManager.cs.
QuantConnect.Lean.Engine.AlgorithmTimeLimitManager.AlgorithmTimeLimitManager | ( | ITokenBucket | additionalTimeBucket, |
TimeSpan | timeLoopMaximum | ||
) |
Initializes a new instance of AlgorithmTimeLimitManager to manage the creation of IsolatorLimitResult instances as it pertains to the algorithm manager's time loop
additionalTimeBucket | Provides a bucket of additional time that can be requested to be spent to give execution time for things such as training scheduled events |
timeLoopMaximum | Specifies the maximum amount of time the algorithm is permitted to spend in a single time loop. This value can be overriden if certain actions are taken by the algorithm, such as invoking the training methods. |
Definition at line 55 of file AlgorithmTimeLimitManager.cs.
void QuantConnect.Lean.Engine.AlgorithmTimeLimitManager.StartNewTimeStep | ( | ) |
Invoked by the algorithm at the start of each time loop. This resets the current time step elapsed time.
This class is the result of a mechanical refactor with the intention of preserving all existing behavior, including setting the
to DateTime.MinValue
Definition at line 70 of file AlgorithmTimeLimitManager.cs.
IsolatorLimitResult QuantConnect.Lean.Engine.AlgorithmTimeLimitManager.IsWithinLimit | ( | ) |
Determines whether or not the algorithm time loop is considered within the limits
Implements QuantConnect.IIsolatorLimitResultProvider.
Definition at line 98 of file AlgorithmTimeLimitManager.cs.
void QuantConnect.Lean.Engine.AlgorithmTimeLimitManager.RequestAdditionalTime | ( | int | minutes | ) |
Requests additional time to continue executing the current time step. At time of writing, this is intended to be used to provide training scheduled events additional time to allow complex training models time to execute while also preventing abuse by enforcing certain control parameters set via the job packet.
Each time this method is invoked, this time limit manager will increase the allowable execution time by the specified number of whole minutes
Implements QuantConnect.IIsolatorLimitResultProvider.
Definition at line 114 of file AlgorithmTimeLimitManager.cs.
bool QuantConnect.Lean.Engine.AlgorithmTimeLimitManager.TryRequestAdditionalTime | ( | int | minutes | ) |
Attempts to requests additional time to continue executing the current time step. At time of writing, this is intended to be used to provide training scheduled events additional time to allow complex training models time to execute while also preventing abuse by enforcing certain control parameters set via the job packet.
Each time this method is invoked, this time limit manager will increase the allowable execution time by the specified number of whole minutes
Implements QuantConnect.IIsolatorLimitResultProvider.
Definition at line 132 of file AlgorithmTimeLimitManager.cs.
|
get |
Gets the additional time bucket which is responsible for tracking additional time requested for processing via long-running scheduled events. In LEAN, we use the LeakyBucket
Definition at line 43 of file AlgorithmTimeLimitManager.cs.