Printing models with parameters
Consider:
model = Model()
@variable(model, y == 18)
@variable(model, p in Parameter(1.3))
@constraint(model, c1, 2y + 3p >= 0)
@objective(model, Min, 5y + 6p)
write_to_file(model, "test_param.mps")
print(read("test_param.mps", String))
The resulting file is:
NAME
ROWS
N OBJ
G c1
COLUMNS
y c1 2
y OBJ 5
x2 c1 3
x2 OBJ 6
RHS
rhs c1 0
RANGES
BOUNDS
FX bounds y 18
FX bounds x2 1.3
ENDATA
It seems that, once the parameter goes to the ParameterToEqualToBridge the name information is lost
I don't think we have a convention for what to do with bridged names.
Do we bridge the variables themselves? or just the constraints? The bridge does not seem to create variables, so why would the name be lost?
It's implemented as a variable bridge: https://github.com/jump-dev/MathOptInterface.jl/blob/master/src/Bridges/Variable/bridges/ParameterToEqualToBridge.jl
So the issue is here:
https://github.com/jump-dev/MathOptInterface.jl/blob/bc869ec1d53bf2d35ddc94cc24b0d35a43e808c5/src/Bridges/bridge_optimizer.jl#L1687-L1700
If the variable is bridged we don't attempt to set the variable name of the inner.
I don't know that I'm strongly motivated to fix this.
Closed by #2822