admin管理员组

文章数量:1022784

By mistake, while defining a CP-SAT model, I've created two variables with the same name:

variable1 = model.NewIntVar(0, cp_model.INT32_MAX, "cool_name")
variable2 = model.NewIntVar(0, cp_model.INT32_MAX, "cool_name")

No error or warning is generated. Does it have any consequence at all?

By mistake, while defining a CP-SAT model, I've created two variables with the same name:

variable1 = model.NewIntVar(0, cp_model.INT32_MAX, "cool_name")
variable2 = model.NewIntVar(0, cp_model.INT32_MAX, "cool_name")

No error or warning is generated. Does it have any consequence at all?

Share Improve this question edited Nov 20, 2024 at 7:04 MarcoM asked Nov 19, 2024 at 10:46 MarcoMMarcoM 1,2042 gold badges10 silver badges26 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

nothing. We do not use names at all in the solver.

By mistake, while defining a CP-SAT model, I've created two variables with the same name:

variable1 = model.NewIntVar(0, cp_model.INT32_MAX, "cool_name")
variable2 = model.NewIntVar(0, cp_model.INT32_MAX, "cool_name")

No error or warning is generated. Does it have any consequence at all?

By mistake, while defining a CP-SAT model, I've created two variables with the same name:

variable1 = model.NewIntVar(0, cp_model.INT32_MAX, "cool_name")
variable2 = model.NewIntVar(0, cp_model.INT32_MAX, "cool_name")

No error or warning is generated. Does it have any consequence at all?

Share Improve this question edited Nov 20, 2024 at 7:04 MarcoM asked Nov 19, 2024 at 10:46 MarcoMMarcoM 1,2042 gold badges10 silver badges26 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

nothing. We do not use names at all in the solver.

本文标签: or toolsWhat Happens if two variables have the same nameStack Overflow