Created
July 4, 2012 04:29
-
-
Save npow/3045339 to your computer and use it in GitHub Desktop.
Dropbox Diet Challenge (https://www.dropbox.com/jobs/challenges#the-dropbox-diet)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sets | |
i activity | |
/ | |
free-lunch, | |
mixed-nuts, | |
orange-juice, | |
heavy-ddr-session, | |
cheese-snacks, | |
cookies, | |
mexican-coke, | |
dropballers-basketball, | |
coding-six-hours, | |
riding-scooter, | |
rock-band, | |
playing-drums | |
/; | |
Parameters | |
c(i) calories | |
/ free-lunch 802 | |
mixed-nuts 421 | |
orange-juice 143 | |
heavy-ddr-session -302 | |
cheese-snacks 137 | |
cookies 316 | |
mexican-coke 150 | |
dropballers-basketball -611 | |
coding-six-hours -466 | |
riding-scooter -42 | |
rock-band -19 | |
playing-drums -295 | |
/; | |
Variables | |
do(i) do | |
z z; | |
Binary variable do(i); | |
Equations | |
objfn objective function | |
check constraint; | |
objfn.. z =e= sum((i), do(i)); | |
check.. 0 =e= sum((i), do(i) * c(i)); | |
Model diet /all/; | |
option iterlim = 999999; | |
option reslim = 999999; | |
option optcr = 0; | |
solve diet using mip maximizing z; |
Author
npow
commented
Jul 4, 2012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment