Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Solvin linear programming problem in ECLiPSe Prolog

36 views
Skip to first unread message

Thomas Wiktowski

unread,
May 29, 2006, 7:49:22 AM5/29/06
to
Hello,

I want to solve a linear programming problem within ECLiPSe Prolog. But
how to do this? I've tried some things, respectively I have some
ideas:

- installing ECLiPSe 5.7 together with xpress (but I've got some
problems there)
- converting simplex.pl from SWI-Prolog to ECLiPSe Prolog, also with
some problems
- Using a LPP-Solver written in C or C++, but which one?

May be, somebody has a good solution for me?

Regards,

Thomas Witkowski

Markus Triska

unread,
May 29, 2006, 8:18:30 AM5/29/06
to
"Thomas Wiktowski" <t-wit...@gmx.de> writes:

> - converting simplex.pl from SWI-Prolog to ECLiPSe Prolog, also with
> some problems

Anything specific? You can safely remove all "clpr_..." predicates if
you aren't interested in the CLP(R) bindings of simplex.pl.

Thomas Wiktowski

unread,
May 29, 2006, 2:45:31 PM5/29/06
to
Markus Triska writes:

> > - converting simplex.pl from SWI-Prolog to ECLiPSe Prolog, also with
> > some problems
>
> Anything specific? You can safely remove all "clpr_..." predicates if
> you aren't interested in the CLP(R) bindings of simplex.pl.

First, I've changed the definition of rational numbers from rdiv (which
is not supported in ECLiPSe in that way) to the ECLiPSe-version of
rational numbers. After that, I can compile simplex.pl without
warnings/errors. But when I try the first example from the
SWI-documentation for simplex.pl, I get the following error:


?- radiation(S), variable_value(S, x1, Val1), variable_value(S, x2,
Val2).

type error in select(c(0, [1 * x1], >=, CRight), [c(0, [0.6 * x1, 0.4 *
x2], >=, 6_1), c(0, [0.5 * x1, 0.5 * x2], =, 6_1), c(0, [0.3 * x1, 0.1
*x2], =<, 27_10)], RestCs)

But I have not thought about what's wrong with it.

Thomas Witkowski

Joachim Schimpf

unread,
May 30, 2006, 8:17:21 AM5/30/06
to

select/3 is an ECLiPSe built-in with a different meaning.
Add the following redefinition at the top of your file:

:- local select/3.
select(X,Y,Z) :- lists:delete(X,Y,Z).


-- Joachim

Joachim Schimpf

unread,
May 30, 2006, 8:18:16 AM5/30/06
to
Thomas Wiktowski wrote:
> Hello,
>
> I want to solve a linear programming problem within ECLiPSe Prolog. But
> how to do this? I've tried some things, respectively I have some
> ideas:
>
> - installing ECLiPSe 5.7 together with xpress (but I've got some
> problems there)

I posted a reply to your question from a few days ago.
What problem do you still have?

-- Joachim

anshu

unread,
May 31, 2012, 12:17:47 AM5/31/12
to
please send me the code of a problem in eclipse
minimise
Z=4x-y
subject to constraint
x-y<=4
2x+y<=24
x,y>0
@@@@damon salvatore reply asap


A.L.

unread,
May 31, 2012, 8:39:11 AM5/31/12
to
How much you pay?

A.L.

Joachim Schimpf

unread,
Jun 8, 2012, 4:18:11 PM6/8/12
to
You can find an example here
http://www.eclipseclp.org/examples/transport1.pl.txt

Cheers,
Joachim
0 new messages