classmethod AMPL.getVariables()
用法
names = getVariables
說明
names = getVariables
獲取當前定義的變量的
。一旦獲得對列表的引用,就會自動與 AMPL 解釋器保持同步。EntityList
示例
獲取模型中定義的變量列表:
ampl.eval('var x{1..3}; var y;');
names = ampl.getVariables()
這將給出:
names =
List of defined variables:
x
y
為了證明保持同步,執行:
ampl.eval('var x;')
names
然後會給出:
names =
List of defined constraints:
x
y
z
相關用法
- Matlab AMPL AMPL.getValue用法及代碼示例
- Matlab AMPL AMPL.getSets用法及代碼示例
- Matlab AMPL AMPL.getObjectives用法及代碼示例
- Matlab AMPL AMPL.getConstraints用法及代碼示例
- 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大神的英文原創作品 getVariables。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。