source: trunk/Bonmin/examples/amplExamples/toy.mod @ 1

Last change on this file since 1 was 1, checked in by andreasw, 13 years ago

imported initial code

File size: 470 bytes
Line 
1   # An Ampl version of toy
2
3   reset;
4
5   var x binary;
6   var z integer >= 0 <= 5;
7   var y{1..2} >=0;
8   minimize cost:
9       - x - y[1] - y[2] ;
10
11   subject to
12       c1: ( y[1] - 1/2 )^2 + (y[2] - 1/2)^2 <= 1/4 ;
13       c2: x - y[1] <= 0 ;
14       c3: x + y[2] + z <= 2;
15
16   option solver bonmin; # Choose BONMIN as the solver (assuming that
17                         # bonmin is in your PATH
18
19   solve;                # Solve the model
20   display x;
21   display y;
22
Note: See TracBrowser for help on using the repository browser.