model ModelName options noimplicit uses "mmxprs" ! uses "mminsight" ! uncomment this line for an Xpress Insight model declarations ITEMS = 1..8 WMAX = 102 x: array(ITEMS) of mpvar p,w: array(ITEMS) of integer profit:linctr end-declarations p::[15, 100, 90, 60, 40, 15, 10, 1] w::[2, 20, 20, 30, 40, 30, 60, 10] writeln("Begin running model") sum(j in ITEMS) w(j)*x(j) <= WMAX profit := sum(j in ITEMS) p(j)*x(j) forall(j in ITEMS) x(j) is_binary maximize(profit) writeln("risultato = ",getobjval) forall(j in ITEMS) writeln("x(",j,") = ",getsol(x(j))) writeln("End running model") end-model