Skip to content

Commit

Permalink
multiobj=2: test multi-QP #239
Browse files Browse the repository at this point in the history
  • Loading branch information
glebbelov committed Jun 17, 2024
1 parent f7e6cab commit 1b66c39
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
33 changes: 33 additions & 0 deletions test/end2end/cases/categorized/fast/multi_obj/dietqobj_1000.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Test correct objective value postsolve in MP
## See AutoLinking

set MINREQ; # nutrients with minimum requirements
set MAXREQ; # nutrients with maximum requirements

set NUTR := MINREQ union MAXREQ; # nutrients
set FOOD; # foods
set STORE; # stores

param cost {STORE,FOOD} > 0;
param f_min {FOOD} >= 0;
param f_max {j in FOOD} >= f_min[j];

param n_min {MINREQ} >= 0;
param n_max {MAXREQ} >= 0;

param amt {NUTR,FOOD} >= 0;

var Buy {j in FOOD} >= f_min[j], <= f_max[j];

minimize total_cost {s in STORE}:
sum {j in FOOD} -cost[s,j] * Buy[j]
+ sum {j in FOOD} Uniform(0.01, 0.2) * Buy[j] * Buy[j]
+ 1000;

minimize total_number: sum {j in FOOD} Buy[j];

subject to diet_min {i in MINREQ}:
sum {j in FOOD} amt[i,j] * Buy[j] >= n_min[i];

subject to diet_max {i in MAXREQ}:
sum {j in FOOD} amt[i,j] * Buy[j] <= n_max[i];
13 changes: 13 additions & 0 deletions test/end2end/cases/categorized/fast/multi_obj/modellist.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,19 @@
"_sobj[4]": 32.84444444444445
}
},
{
"name" : "dietQobj_1000 multiobj=2",
"tags" : ["quadratic", "quadratic_obj", "multiobj"],
"files" : ["dietqobj_1000.mod", "dietobj.dat"],
"options": { "ANYSOLVER_options": "multiobj=2" },
"values": {
"total_cost[\"A&P\"]": 920.6492623659187,
"total_cost[\"JEWEL\"]": 914.6919717993438,
"total_cost[\"VONS\"]": 914.081415223036,
"total_number": 44.80888220421118,
"_sobj[4]": 44.80888220421118
}
},
{
"name" : "dietobj multiobj=1 obj:2:priority=10",
"Comment": "Modify obj priority via an option",
Expand Down

0 comments on commit 1b66c39

Please sign in to comment.