For Programmers: Free Programming Magazines  


Home > Archive > Prolog > November 2007 > Problem with ECLiPSe and eplex









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Problem with ECLiPSe and eplex
jm

2007-11-04, 8:10 am

Dear all,

I have the following simple linear program :
:- lib(eplex).

problem1(Nbfreq, Vars) :-
Vars = [C_1 ,C_2 ,C_3 ,
S_1_1 ,S_1_2 ,S_1_3 ,
S_2_1 ,S_2_2 ,S_2_3 ,
S_3_1 ,S_3_2 ,S_3_3 ,
S_4_1 ,S_4_2 ,S_4_3 ],

C_1 $>= 0,
C_2 $>= 0,
C_3 $>= 0,

S_1_1 $>= 0,
S_1_2 $>= 0,
S_1_3 $>= 0,

S_2_1 $>= 0,
S_2_2 $>= 0,
S_2_3 $>= 0,

S_3_1 $>= 0,
S_3_2 $>= 0,
S_3_3 $>= 0,

S_4_1 $>= 0,
S_4_2 $>= 0,
S_4_3 $>= 0,

S_1_1 + S_2_1 $=< C_1,
S_1_1 + S_4_1 $=< C_1,
S_2_1 + S_3_1 $=< C_1,
S_3_1 + S_4_1 $=< C_1,
S_1_2 + S_2_2 $=< C_2,
S_1_2 + S_4_2 $=< C_2,
S_2_2 + S_3_2 $=< C_2,
S_3_2 + S_4_2 $=< C_2,
S_1_3 + S_2_3 $=< C_3,
S_1_3 + S_4_3 $=< C_3,
S_2_3 + S_3_3 $=< C_3,
S_3_3 + S_4_3 $=< C_3,

S_1_1 + S_1_2 + S_1_3 = 1,
S_2_1 + S_2_2 + S_2_3 = 1,
S_3_1 + S_3_2 + S_3_3 = 1,
S_4_1 + S_4_2 + S_4_3 = 1,

optimize(min(C_1 + C_2 + C_3), Nbfreq).


It loads perfectly with ECLiPSe but when I want to solve it using

problem1(Nbfreq, Vars).

I get the message : No (0.00s cpu)

This problem has an easy solution (found by lp_solve), so I don't
understand why ECLiPSe doesn't succeed...

Somebody has an idea ?

Thanks to all,

JM
Neng-Fa Zhou

2007-11-04, 7:08 pm

"jm" <jm@alb.fr> wrote in message
news:472da441$0$21150$7a628cd7@news.club-internet.fr...
>
> S_1_1 + S_1_2 + S_1_3 = 1,
> S_2_1 + S_2_2 + S_2_3 = 1,
> S_3_1 + S_3_2 + S_3_3 = 1,
> S_4_1 + S_4_2 + S_4_3 = 1,


In these four equations, = should be $=.

Cheers,
Neng-Fa



jm

2007-11-04, 7:08 pm

Thanks you very much, it was so evident that I didn't see it !!

Thanks a lot,

JM
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com