行号

(函数来自 pyomo.contrib.sensitivity_toolbox.sens)

pyomo.contrib.sensitivity_toolbox.sens.line_num(file_name, target)[source]

此函数返回在文件_name中包含'target'的行号。此函数识别在theta_names中包含变量的约束。

Parameters:
  • file_name (string) – 文件包含变量顺序(即列文件)

  • target (string) – 要检查的变量名

Returns:

count – 文件中目标的行号

Return type:

int

Raises:

Exception – 当文件不包含目标时