|
64 | 64 | }, |
65 | 65 | { |
66 | 66 | "cell_type": "code", |
67 | | - "execution_count": 7, |
| 67 | + "execution_count": 3, |
68 | 68 | "metadata": {}, |
69 | 69 | "outputs": [ |
70 | 70 | { |
|
73 | 73 | "lower_problem! (generic function with 3 methods)" |
74 | 74 | ] |
75 | 75 | }, |
76 | | - "execution_count": 7, |
| 76 | + "execution_count": 3, |
77 | 77 | "metadata": {}, |
78 | 78 | "output_type": "execute_result" |
79 | 79 | } |
|
92 | 92 | " F = sin(x_value[1])x_value[2]^2-cos(x_value[3])/x_value[4]\n", |
93 | 93 | " \n", |
94 | 94 | " x._lower_objective_value = F.lo\n", |
95 | | - " x._lower_solution = mid.(x_value)\n", |
| 95 | + " x._lower_solution = IntervalArithmetic.mid.(x_value)\n", |
96 | 96 | " x._lower_feasibility = true\n", |
97 | 97 | " x._cut_add_flag = false\n", |
98 | 98 | " \n", |
|
112 | 112 | "cell_type": "code", |
113 | 113 | "execution_count": 4, |
114 | 114 | "metadata": {}, |
115 | | - "outputs": [ |
116 | | - { |
117 | | - "data": { |
118 | | - "text/plain": [ |
119 | | - "upper_problem! (generic function with 1 method)" |
120 | | - ] |
121 | | - }, |
122 | | - "execution_count": 4, |
123 | | - "metadata": {}, |
124 | | - "output_type": "execute_result" |
125 | | - } |
126 | | - ], |
| 115 | + "outputs": [], |
127 | 116 | "source": [ |
128 | 117 | "import EAGO.upper_problem!\n", |
129 | 118 | "function EAGO.upper_problem!(t::IntervalExt, x::EAGO.Optimizer)\n", |
|
148 | 137 | "cell_type": "markdown", |
149 | 138 | "metadata": {}, |
150 | 139 | "source": [ |
151 | | - "### Disable unecessary routines.\n", |
| 140 | + "### Disable unnecessary routines.\n", |
152 | 141 | "It is entirely possible to disable domain reduction by manipulating keyword arguments supplied to the optimizer. However, for simplicity sake we'll simply overload the default preprocessing and postprocessing methods," |
153 | 142 | ] |
154 | 143 | }, |
|
180 | 169 | }, |
181 | 170 | { |
182 | 171 | "cell_type": "code", |
183 | | - "execution_count": null, |
| 172 | + "execution_count": 6, |
184 | 173 | "metadata": {}, |
185 | | - "outputs": [], |
| 174 | + "outputs": [ |
| 175 | + { |
| 176 | + "name": "stdout", |
| 177 | + "output_type": "stream", |
| 178 | + "text": [ |
| 179 | + "-------------------------------------------------------------------------------------------------------\n", |
| 180 | + "| Iteration # | Nodes | Lower Bound | Upper Bound | Gap | Ratio | Time | Time Left |\n", |
| 181 | + "-------------------------------------------------------------------------------------------------------\n", |
| 182 | + "First Solution Found at Node 1107\n", |
| 183 | + "UBD = -1.4989611040367379\n", |
| 184 | + "Solution is :\n", |
| 185 | + " X[1] = -1.56982421875\n", |
| 186 | + " X[2] = -0.999755859375\n", |
| 187 | + " X[3] = -0.00244140625\n", |
| 188 | + " X[4] = 2.002197265625\n" |
| 189 | + ] |
| 190 | + } |
| 191 | + ], |
186 | 192 | "source": [ |
187 | 193 | "# Creates a JuMP model with the the lower_problem, upper_problem, and absolute tolerance set by keyword arguments\n", |
188 | 194 | "m = JuMP.Model(with_optimizer(EAGO.Optimizer, absolute_tolerance = 0.001, obbt_depth = 0, dbbt_depth = 0, cp_depth = 0,\n", |
|
215 | 221 | "### Get information from the JuMP Model object\n", |
216 | 222 | "The objective value, solution, termination status, and primal status can then be accessed via the standard JuMP interface." |
217 | 223 | ] |
218 | | - } |
| 224 | + }, |
219 | 225 | { |
220 | 226 | "cell_type": "code", |
221 | | - "execution_count": 6, |
| 227 | + "execution_count": 7, |
222 | 228 | "metadata": {}, |
223 | 229 | "outputs": [ |
224 | 230 | { |
225 | 231 | "name": "stdout", |
226 | 232 | "output_type": "stream", |
227 | 233 | "text": [ |
228 | 234 | "EAGO terminated with a status of OPTIMAL and a result code of FEASIBLE_POINT\n", |
229 | | - "The optimal value is: -1.691376119161244, the solution found is [0.3125, 0.03125, 0.3125, 0.5625].\n" |
| 235 | + "The optimal value is: -1.4989611040367379, the solution found is [-1.56982421875, -0.999755859375, -0.00244140625, 2.002197265625].\n" |
230 | 236 | ] |
231 | 237 | } |
232 | 238 | ], |
|
256 | 262 | } |
257 | 263 | ], |
258 | 264 | "metadata": { |
| 265 | + "@webio": { |
| 266 | + "lastCommId": null, |
| 267 | + "lastKernelId": null |
| 268 | + }, |
259 | 269 | "kernelspec": { |
260 | | - "display_name": "Julia 1.1.0", |
| 270 | + "display_name": "Julia 1.3.1", |
261 | 271 | "language": "julia", |
262 | | - "name": "julia-1.1" |
| 272 | + "name": "julia-1.3" |
263 | 273 | }, |
264 | 274 | "language_info": { |
265 | 275 | "file_extension": ".jl", |
266 | 276 | "mimetype": "application/julia", |
267 | 277 | "name": "julia", |
268 | | - "version": "1.1.0" |
| 278 | + "version": "1.3.1" |
269 | 279 | } |
270 | 280 | }, |
271 | 281 | "nbformat": 4, |
|
0 commit comments