CAEngine::DefaultEvaluationTimeLimit
ADE User Guide > ADE Server Class Reference > CAObject
描述
CAObject的这个属性指明该对象中发生的计算所使用的最大时间限制(毫秒)可以用来确保方法调用最终将返回,即使模型包含一个无线循环,后者比续期消耗更长的时间。
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.
数据类型
long int:长整型
访问
读 / 写
示例用法
CAObject obj = ade.GetObjectByName("Projected_profit") obj.MethodEvaluationTimeLimit = 50000; CATable result = obj.ResultTable; if (ade.ErrorCode == 77) { /* computation timed out */ }
错误代码
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 – "方法计算超出允许的时间限制"
Enable comment auto-refresher