Difference between revisions of "CAObject::MethodEvaluationTimeLimit"
(Marked this version for translation) |
|||
Line 3: | Line 3: | ||
<languages /> | <languages /> | ||
<translate> | <translate> | ||
+ | <!--T:1--> | ||
''new to [[What's new in Analytica 4.1?|ADE 4.1]]'' | ''new to [[What's new in Analytica 4.1?|ADE 4.1]]'' | ||
− | = Description = | + | = Description = <!--T:2--> |
+ | <!--T:3--> | ||
This property of [[CAObject]] specifies a maximum time limit in milliseconds on evaluations that occur from this object. It can be used to ensure that a method call will eventually return even if the model has an infinite loop, or takes much longer than otherwise expected. | This property of [[CAObject]] specifies a maximum time limit in milliseconds on evaluations that occur from this object. It can be used to ensure that a method call will eventually return even if the model has an infinite loop, or takes much longer than otherwise expected. | ||
+ | <!--T:4--> | ||
This impacts primarily the methods [[CAObject::Evaluate]], [[CAObject::Result]] and [[CAObject::ResultTable]]. In some cases it can also impact [[CAObject::DefTable]] when a table index requires computation. When a timeout occurs when calling these methods, the [[CAEngine::ErrorCode]] is set to 77 ("Method Evaluation Time Limit exceeded"). Note that a computation may also abort (if the Break event is signalled externally) and return [[CAEngine::ErrorCode]]=78 ("Computation aborted"). | This impacts primarily the methods [[CAObject::Evaluate]], [[CAObject::Result]] and [[CAObject::ResultTable]]. In some cases it can also impact [[CAObject::DefTable]] when a table index requires computation. When a timeout occurs when calling these methods, the [[CAEngine::ErrorCode]] is set to 77 ("Method Evaluation Time Limit exceeded"). Note that a computation may also abort (if the Break event is signalled externally) and return [[CAEngine::ErrorCode]]=78 ("Computation aborted"). | ||
+ | <!--T:5--> | ||
(in ADE 4.3) Its value is inherited from [[CAEngine::DefaultEvaluationTimeLimit]] when the [[CAObject]] is first created. Changing the value of [[CAEngine::DefaultEvaluationTimeLimit]] has no impact on [[CAObject]]s that already exist at that time. | (in ADE 4.3) Its value is inherited from [[CAEngine::DefaultEvaluationTimeLimit]] when the [[CAObject]] is first created. Changing the value of [[CAEngine::DefaultEvaluationTimeLimit]] has no impact on [[CAObject]]s that already exist at that time. | ||
+ | <!--T:6--> | ||
A value of zero (the usual default) means that there is no time limit. Method calls will not return until the computation is complete or terminates (e.g., due to an evaluation error) or [[How to Abort an ADE Computation|the Abort event is triggered]]. It may never return if the model contains an infinite loop. | A value of zero (the usual default) means that there is no time limit. Method calls will not return until the computation is complete or terminates (e.g., due to an evaluation error) or [[How to Abort an ADE Computation|the Abort event is triggered]]. It may never return if the model contains an infinite loop. | ||
− | = Data type = | + | = Data type = <!--T:7--> |
+ | <!--T:8--> | ||
long int | long int | ||
− | = Access = | + | = Access = <!--T:9--> |
+ | <!--T:10--> | ||
read/write | read/write | ||
− | = Example Usage = | + | = Example Usage = <!--T:11--> |
− | CAObject obj = ade.[[CAObject::GetObjectByName|GetObjectByName]]("Projected_profit") | + | <!--T:12--> |
+ | CAObject obj = ade.[[CAObject::GetObjectByName|GetObjectByName]]("Projected_profit") | ||
obj.[[CAObject::MethodEvaluationTimeLimit|MethodEvaluationTimeLimit]] = 50000; | obj.[[CAObject::MethodEvaluationTimeLimit|MethodEvaluationTimeLimit]] = 50000; | ||
CATable result = obj.[[CAObject::ResultTable|ResultTable]]; | CATable result = obj.[[CAObject::ResultTable|ResultTable]]; | ||
Line 32: | Line 40: | ||
} | } | ||
− | = [[ErrorCode]]s = | + | = [[ErrorCode]]s = <!--T:13--> |
+ | <!--T:14--> | ||
The ErrorCode is not changed by reading or writing a property like this, but when calling other methods when a time limit is in force, you may encounter this error code from them: | The ErrorCode is not changed by reading or writing a property like this, but when calling other methods when a time limit is in force, you may encounter this error code from them: | ||
+ | <!--T:15--> | ||
* 77 – "Method Evaluation Time Limit exceeded" | * 77 – "Method Evaluation Time Limit exceeded" | ||
− | = See Also = | + | = See Also = <!--T:16--> |
+ | <!--T:17--> | ||
* [[CAEngine::DefaultEvaluationTimeLimit]] | * [[CAEngine::DefaultEvaluationTimeLimit]] | ||
* [[How to Abort an ADE Computation]] | * [[How to Abort an ADE Computation]] | ||
</translate> | </translate> |
Latest revision as of 00:34, 16 June 2015
ADE User Guide > ADE Server Class Reference > CAObject
new to ADE 4.1
Description
This property of CAObject specifies a maximum time limit in milliseconds on evaluations that occur from this object. It can be used to ensure that a method call will eventually return even if the model has an infinite loop, or takes much longer than otherwise expected.
This impacts primarily the methods CAObject::Evaluate, CAObject::Result and CAObject::ResultTable. In some cases it can also impact CAObject::DefTable when a table index requires computation. When a timeout occurs when calling these methods, the CAEngine::ErrorCode is set to 77 ("Method Evaluation Time Limit exceeded"). Note that a computation may also abort (if the Break event is signalled externally) and return CAEngine::ErrorCode=78 ("Computation aborted").
(in ADE 4.3) Its value is inherited from CAEngine::DefaultEvaluationTimeLimit when the CAObject is first created. Changing the value of CAEngine::DefaultEvaluationTimeLimit has no impact on CAObjects that already exist at that time.
A value of zero (the usual default) means that there is no time limit. Method calls will not return until the computation is complete or terminates (e.g., due to an evaluation error) or the Abort event is triggered. It may never return if the model contains an infinite loop.
Data type
long int
Access
read/write
Example Usage
CAObject obj = ade.GetObjectByName("Projected_profit") obj.MethodEvaluationTimeLimit = 50000; CATable result = obj.ResultTable; if (ade.ErrorCode == 77) { /* computation timed out */ }
ErrorCodes
The ErrorCode is not changed by reading or writing a property like this, but when calling other methods when a time limit is in force, you may encounter this error code from them:
- 77 – "Method Evaluation Time Limit exceeded"
Enable comment auto-refresher