users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to do soft constraints (not FD) in GNU Prolog?


From: Anthony Mak
Subject: How to do soft constraints (not FD) in GNU Prolog?
Date: Wed, 10 May 2006 11:25:49 +1000
User-agent: Mozilla Thunderbird 0.9 (X11/20041124)

I wonder how can I do soft constraint (not FD constraint) in GNU Prolog? For example in the following problem.

schedule(....):-
  time_constraint(....),
  ability_check(...),
  sex_constraint(....).

Suppose I have a predicate and there are some conditions that it must
satisfy. How can I make one of the predicates
into a soft constraint, for example such that the sex_constraint does
not have to be true all the times but should maximize such that it is
true as much as possible?

In GNU Prolog's FD solver, it is possible to use reified constraints and
the fd_maximize()
function, I wonder if I can do something similiar in my case? I thought
of using an if then else statement such then when the sex_constraint is
true I assign some numerical value to a variable and then try to
maximize the sum of it but it seems GNU prolog only have a maximize
function for finite domain type constraints.

Anthony Mak




reply via email to

[Prev in Thread] Current Thread [Next in Thread]