2. cd Bonmin-1.3.2
3. ./configure -C
4. make
5. make test
6. make install
Everything went fine, but it was the following error
"configure: WARNING: Failed to find a Fortran compiler!"
Maybe you need to install Fortran?
I wanted to compile separately Bonmin
Go to folder Bonmin
2. cd Bonmin
3. ./configure -C
4. make
But make file not found
"make: *** No targets specified and not found make-file. Stop."
www.coin-or.org/download/binary/Bonmin
www.coin-or.org/download/binary/Couenne
These binaries contain AMPL interfaces, so they can be used from AMPL by
putting them in your search path and setting "option solver bonmin;" or
"option solver couenne;".
Bonmin is designed for convex MINLPs, though it will try to find a good
solution for nonconvex ones. Couenne is designed to find optimal solutions
even to nonconvex MINLPs. Of course as with all very hard problems, success
is not guaranteed, and some experimentation with formulations and
algorithmic options may be necessary. Problems should be reported to the
appropriate COIN-OR project managers; see the project home pages at
www.coin-or.org for details.
Bob Fourer
4...@ampl.com
set P; #numbers in hotel
set N;
param dn {j in P};
param dk {j in P};
param dn1 {j in P};
param dk1 {j in P};
var zakaz {j in P} binary;
var daz {j in P} integer;
var dav {j in P} integer;
#param k {j in P} = dz[j]-dv[j]+1;
maximize Total_Profit: sum {j in P} (dav[j]-daz[j]+1+1) * zakaz[j];
#subject to Time: sum {j in P} (dav[j]-daz[j]+1) * zakaz[j] <= b;
#subject to Limit {j in P}: 0 <= zakaz[j] <= dv[j];
#subject to Limit: zakaz[1]*dz[1]<=zakaz[2]*dz[2];
subject to Limit {j in P}: dn[j] <= daz[j] <= dk[j];
subject to Limit1 {j in P}: dn1[j] <= dav[j] <= dk1[j];
subject to stp {i in N}: dav[i]*zakaz[i] <= daz[i+1]*zakaz[i+1] ;
#subject: zakaz[1]=1;
####################### DАТА #########################
data;
set P := 1 2 3 4;
set N := 1 2 3 ;
param: dn dk dn1 dk1 :=
1 1 1 7 7
2 5 5 8 8
3 7 9 9 9
4 9 9 10 10;
eRROR:
bonmin:
ANALYSIS TEST: <BREAK>
*** Error: ifnl not implemented
exit code 255
if (a) then b else c
where b and c are expressions and a is a condition? Couenne cannot
read (yet) a conditional expression (defined by the nonlinear AMPL
operator "ifnl"). If there is a way to define that expression that
does not require an "if" (for instance because the "if" is used to
define an absolute value), Couenne should be able to handle it.
Pietro Belotti
> --
> You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
> To post to this group, send email to am...@googlegroups.com.
> To unsubscribe from this group, send email to ampl+uns...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ampl?hl=en.
subject to hL_Ss1 {i in P, j in P: i<>j}:
zakaz[i,j]=ifnl dav[i]<=daz[j] then daz[j]-dav[i] else dav[i]-daz[j];
but but anyway error:
ifnl is not defined
context: ifnl >>> dav[ <<< i]<=daz[j] then daz[j]-dav[i] else dav[i]-
daz[j];
command returned 2
subject to hL_Ss1 {i in P, j in P: i<>j}:
zakaz [i,j] = abs (dav [i] - daz [j]);
The right-hand side of your constraint is indeed the definition of the
absolute value of daz[j]-dav[i].
Pietro
subject to stp {i in N}: dav[i]*zakaz[i] < daz[i+1]*zakaz[i+1] ;
param epsilon > 0 default 1e-5;
subject to stp {i in N}: dav[i]*zakaz[i] <= daz[i+1]*zakaz[i+1] - epsilon;
However, if, for your particular problem, the product of dav and zakaz
is known to be an integer or a multiple of k, you can safely set
epsilon to k.
Pietro
k????
set P;
param epsilon > 0 default 1e-5;
param dn {j in P} integer;
param dk {j in P} integer;
param dn1 {j in P} integer;
param dk1 {j in P} integer;
var zakaz {i in P, j in P} integer;
var zakaz1 {i in P, j in P} binary;
var zakaz2 {i in P, j in P} binary;
var daz {j in P} integer;
var dav {j in P} integer;
maximize Total_Profit {i in P, j in P :i<>j}: (zakaz1[i,j]
+zakaz2[i,j]);
maximize Total_Profit2 {i in P}: dav[i]-daz[i];
minimize Total_Profit3 {i in P, j in P :i<>j}: zakaz[i,j];
#minimize Total_Profit4 {i in P}: daz[i];
subject to Limit {j in P}: dn[j] <= daz[j] <= dk[j];
subject to Limit1 {j in P}: dn1[j] <= dav[j] <= dk1[j];
subject to hL_Ss1 {i in P, j in P: i<>j}:
zakaz [i,j] = abs (dav [i] - daz [j]);
subject to hL_Ss {i in P, j in P: i<>j}:
dav[i]*zakaz1[i,j]<=daz[j]*zakaz2[i,j]+epsilon;
####################### DАТА #########################
data;
set P := 1 2 3;
param: dn dk dn1 dk1 :=
1 11 13 20 22
2 1 6 5 5
3 4 8 7 12
;
subject to stp {i in N}: dav[i]*zakaz[i] <= daz[i+1]*zakaz[i+1] - 1;
Notice the minus sign. It needs to be minus and not plus as you write
in your model (before epsilon). Also, your model has many objective
functions. Couenne, if you still plan to use it, only works with one
objective function.
Pietro
I use Couenne solver
He gives very good results.
This restriction does not help.
subject to stp (i in N): dav [i] * zakaz [i] <= daz [i +1] * zakaz [i
+1] - 1;
In some cases, dav [i] = daz [i +1]
subject to stp2 (i in N): dav [i] <= daz [i +1] - 1;
Pietro
Pietro
On Thu, Apr 8, 2010 at 12:23 PM, nadir <nadir.a...@googlemail.com> wrote:
> Error (:
> Warning, could not install cutoff - negative objective index
>
set P;
param dn {j in P} integer;
param dk {j in P} integer;
param dn1 {j in P} integer;
param dk1 {j in P} integer;
var zakaz {i in P, j in P} integer;
var daz {j in P} integer;
var dav {j in P} integer;
minimize Total_Profit: sum {i in P, j in P:i<j} zakaz[i,j];
subject to Limit {j in P}: dn[j] <= daz[j] <= dk[j];
subject to Limit1 {j in P}: dn1[j] <= dav[j] <= dk1[j];
subject to hL_Ss1 {i in P, j in P: i<j}:
zakaz [i,j] = abs (dav [i] - daz [j]);
subject to hL_Ss2 {i in P: i<>4}:
dav [i] <= (daz [i+1]-1);
####################### DАТА #########################
data;
set P := 1 2 3 4;
param: dn dk dn1 dk1 :=
1 1 2 4 5
2 4 8 10 12
3 10 10 18 22
4 20 23 26 28
;
ampl: expand dav[2];
Coefficients of dav[2]:
Limit1[2] 1
hL_Ss1[2,3] 0 + nonlinear
hL_Ss1[2,4] 0 + nonlinear
hL_Ss2[2] 1
Since presolve only works on linear constraints, I asked to look at the two constraints that involve dav[2] and that do not have any nonlinear terms:
ampl: expand Limit1[2];
subject to Limit1[2]:
10 <= dav[2] <= 12;
ampl: expand hL_Ss2[2];
subject to hL_Ss2[2]:
-daz[3] + dav[2] <= -1;
A little further investigation showed that daz[3] is bounded by constraint Limit[3]:
ampl: expand Limit[3];
subject to Limit[3]:
daz[3] = 10;
So it is seen that while Limit1[2] requires dav[2] >= 10, hL_Ss2[2] implies dav[2] <= daz[3] - 1 = 9.
If you want to solve this problem efficiently then it would be well to replace the nonlinear constraint
zakaz[i,j] = abs (dav[i] - daz[j])
by the two linear constraints
zakaz[i,j] >= dav[i] - daz[j]
zakaz[i,j] >= daz[j] - dav[i]
Bob Fourer
4...@ampl.com
> -----Original Message-----
> From: am...@googlegroups.com [mailto:am...@googlegroups.com]
> On Behalf Of nadir [nadir.a...@googlemail.com]
> Sent: Monday, April 12, 2010 4:18 AM
> To: AMPL Modeling Language
subject to hL_Ss2 {i in P, j in P: j<>3, i<j}:
dav[i]*zakaz[i,j+1] <= (daz [j+1]-1)*zakaz1[i,j+1];