classmethod AMPL.getConstraints()
用法
names = getConstraints
說明
names = getConstraints
獲取當前定義的約束的
。一旦獲得對列表的引用,就會自動與 AMPL 解釋器保持同步。EntityList
示例
獲取模型中定義的約束列表:
ampl.eval('var x{1..3}; c{i in 1..2}: x[i] <= i; c2: x[3] <= 10;');
names = ampl.getConstraints()
這將給出:
names =
List of defined constraints:
c2
c
為了證明保持同步,執行:
ampl.eval('c3: x[1]<=0;')
names
然後會給出:
names =
List of defined constraints:
c2
c
c3
相關用法
- Matlab AMPL AMPL.getSets用法及代碼示例
- Matlab AMPL AMPL.getObjectives用法及代碼示例
- Matlab AMPL AMPL.getValue用法及代碼示例
- Matlab AMPL AMPL.getVariables用法及代碼示例
- Matlab AMPL AMPL.getParameters用法及代碼示例
- Matlab AMPL AMPL.getData用法及代碼示例
- Matlab AMPL AMPL.getOption用法及代碼示例
- Matlab AMPL AMPL.getEntity用法及代碼示例
- Matlab AMPL AMPL.eval用法及代碼示例
- Matlab AMPL AMPL.close用法及代碼示例
- Matlab AMPL AMPL.solve用法及代碼示例
- Matlab AMPL AMPL.initializeEvents用法及代碼示例
- Matlab AMPL AMPL.expand用法及代碼示例
- Matlab AMPL AMPL.setOption用法及代碼示例
- Matlab AMPL AMPL.reset用法及代碼示例
- Matlab AMPL AMPL.display用法及代碼示例
- Matlab AMPL AMPL.isRunning用法及代碼示例
- Matlab AMPL AMPL.setData用法及代碼示例
- Matlab AMPL AMPL.show用法及代碼示例
- Matlab AMPL AMPL.read用法及代碼示例
注:本文由純淨天空篩選整理自ampl.com大神的英文原創作品 getConstraints。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。