メインコンテンツへスキップ

Extract gurobi 3-dimensional variable value to a ndarray?

回答済み

コメント

1件のコメント

  • Mario Ruthmair
    • Gurobi Staff

    Hi Scott,

    The easiest way to get the solution values and access them in the same way as the variables is via:

    values = model.getAttr("X", self.model.getVars())

    The method returns a dictionary with the same keys as the variables. This should also be much faster than using getVarByName() for each variable.

    Best regards,
    Mario

    0

サインインしてコメントを残してください。