CAEngine::DefaultEvaluationTimeLimit

This page is a translated version of the page CAObject::MethodEvaluationTimeLimit and the translation is 100% complete.

ADE User Guide > ADE Server Class Reference > CAObject

Other languages:
English • ‎中文

ADE 4.1新特徵

描述

CAObject的這個屬性指明該對象中發生的計算所使用的最大時間限制(毫秒)可以用來確保方法調用最終將返回,即使模型包含一個無線循環,後者比續期消耗更長的時間。

這主要影響CAObject::EvaluateCAObject::ResultCAObject::ResultTable等方法。在某些情況下,當一個表格索引需要計算時,對CAObject::DefTable也有影響。在調用這些方法時,如果時限已到,CAEngine::ErrorCode將被設定為77("方法計算以超出最大時間限制")。注意計算也可能終止(如果中斷事件最終被觸發)並放回CAEngine::ErrorCode=78 ("計算終止")

(在ADE4.3中)當CAObject先建立時,其值從CAEngine::DefaultEvaluationTimeLimit中繼承。改變CAEngine::DefaultEvaluationTimeLimit的值對已經存在的CAObject沒有影響。

0值(通常默認值)表示沒有時間限制。方法調用不會返回,一直等到計算完成或者終止(例如,由於計算錯誤)或者終止事件被觸發。如果模型包含一個無線循環,它將永遠不會返回。

數據類型

long int:長整型

存取

讀 / 寫

示例用法

CAObject obj = ade.GetObjectByName("Projected_profit")
obj.MethodEvaluationTimeLimit = 50000;
CATable result = obj.ResultTable;
if (ade.ErrorCode == 77) {
   /* computation timed out */
}

錯誤代碼

次ErrorCode(錯誤代碼)通過讀取或者寫入這樣的屬性改變,但是,在調用其它方法時間限制被強制時,你可能遇到來自它們的此錯誤代碼。

  • 77 – "方法計算超出允許的時間限制"

另請參考

Comments


You are not allowed to post comments.