获取主窗口

(函数来自 pyomo.contrib.viewer.ui)

pyomo.contrib.viewer.ui.get_mainwindow(model=None, show=True, ask_close=True, model_var_name_in_main=None, testing=False)[源代码]

创建一个UI主窗口。

Parameters:
  • model – 一个用于工作的Pyomo模型

  • show – 在窗口创建后显示它

  • ask_close – 确认关闭窗口

  • 测试 – 如果为True,则预期进行测试

Returns:

ui 是 MainWindow 小部件,model 是链接的 Pyomo

模型。如果没有提供模型,则会创建一个新的 ConcreteModel

Return type:

(ui, model)