84
84
# Variable printing.
85
85
86
86
function write_variable (io:: IO , name:: String , s:: MOI.EqualTo{Float64} )
87
- print (io, " var float: $(name) = $(s. value) ;" )
87
+ print (io, " var float: $(name) = $(s. value) :: output_var ;" )
88
88
return nothing
89
89
end
90
90
91
91
function write_variable (io:: IO , name:: String , s:: MOI.EqualTo{Int} )
92
- print (io, " var int: $(name) = $(s. value) ;" )
92
+ print (io, " var int: $(name) = $(s. value) :: output_var ;" )
93
93
return nothing
94
94
end
95
95
96
96
function write_variable (io:: IO , name:: String , s:: MOI.EqualTo{Bool} )
97
- print (io, " var bool: $(name) = $(s. value) ;" )
97
+ print (io, " var bool: $(name) = $(s. value) :: output_var ;" )
98
98
return nothing
99
99
end
100
100
101
101
function write_variable (io:: IO , name:: String , s:: MOI.LessThan{Float64} )
102
102
# typemin(Float64) is -Inf, which is "-Inf" as a string (which is not
103
103
# allowed by FlatZinc). Take the next smallest value as a proxy, because
104
104
# it has a standard scientific notation (and this is allowed in FlatZinc).
105
- print (io, " var $(nextfloat (typemin (Float64))) ..$(s. upper) : $(name) ;" )
105
+ print (io, " var $(nextfloat (typemin (Float64))) ..$(s. upper) : $(name) :: output_var ;" )
106
106
return nothing
107
107
end
108
108
109
109
function write_variable (io:: IO , name:: String , s:: MOI.LessThan{Int} )
110
- print (io, " var $(typemin (Int)) ..$(s. upper) : $(name) ;" )
110
+ print (io, " var $(typemin (Int)) ..$(s. upper) : $(name) :: output_var ;" )
111
111
return nothing
112
112
end
113
113
114
114
function write_variable (io:: IO , name:: String , s:: MOI.GreaterThan{Float64} )
115
115
# typemax(Float64) is Inf, which is "Inf" as a string (which is not
116
116
# allowed by FlatZinc). Take the next largest value as a proxy, because
117
117
# it has a standard scientific notation (and this is allowed in FlatZinc).
118
- print (io, " var $(s. lower) ..$(prevfloat (typemax (Float64))) : $(name) ;" )
118
+ print (io, " var $(s. lower) ..$(prevfloat (typemax (Float64))) : $(name) :: output_var ;" )
119
119
return nothing
120
120
end
121
121
122
122
function write_variable (io:: IO , name:: String , s:: MOI.GreaterThan{Int} )
123
- print (io, " var $(s. lower) ..$(typemax (Int)) : $(name) ;" )
123
+ print (io, " var $(s. lower) ..$(typemax (Int)) : $(name) :: output_var ;" )
124
124
return nothing
125
125
end
126
126
@@ -129,22 +129,22 @@ function write_variable(
129
129
name:: String ,
130
130
s:: MOI.Interval{T} ,
131
131
) where {T <: Union{Int, Float64} }
132
- print (io, " var $(s. lower) ..$(s. upper) : $(name) ;" )
132
+ print (io, " var $(s. lower) ..$(s. upper) : $(name) :: output_var ;" )
133
133
return nothing
134
134
end
135
135
136
136
function write_variable (io:: IO , name:: String , :: MOI.Reals )
137
- print (io, " var float: $(name) ;" )
137
+ print (io, " var float: $(name) :: output_var ;" )
138
138
return nothing
139
139
end
140
140
141
141
function write_variable (io:: IO , name:: String , :: MOI.ZeroOne )
142
- print (io, " var bool: $(name) ;" )
142
+ print (io, " var bool: $(name) :: output_var ;" )
143
143
return nothing
144
144
end
145
145
146
146
function write_variable (io:: IO , name:: String , :: MOI.Integer )
147
- print (io, " var int: $(name) ;" )
147
+ print (io, " var int: $(name) :: output_var ;" )
148
148
return nothing
149
149
end
150
150
0 commit comments