CAEngine::DefaultEvaluationTimeLimit
ADE User Guide > ADE Server Class Reference > CAObject
描述
CAObject的这个属性指明该对象中发生的计算所使用的最大时间限制(毫秒)可以用来确保方法调用最终将返回,即使模型包含一个无线循环,后者比续期消耗更长的时间。
这主要影响CAObject::Evaluate、CAObject::Result和CAObject::ResultTable等方法
(在ADE4.3中)当CAObject先建立时,其值从CAEngine::DefaultEvaluationTimeLimit中继承。改变CAEngine::DefaultEvaluationTimeLimit的值对已经存在的CAObject没有影响。
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