How to do soft constraints (not FD) in GNU Prolog?
Anthony Mak <[email protected]>
| Newsgroups | gmane.comp.gnu.prolog.general |
|---|---|
| Organization | National ICT Australia (Canberra office) |
| Message-ID | <[email protected]> |
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