Re: [eclipse-clp-users] How to Have all the solution of a problem

From: Kish Shen <kisshen_at_...5...>
Date: Thu, 04 Mar 2010 21:12:57 +0000
Meriem Djefel wrote:
 > Deal all,
 > I have two questions :
 > 1. I want to how  we can have all the solution of a problem in 
eclipse without use the command *more *to have the next solution.

As Christian says, if you want to collect all the solutions, you can use 
  findall and friends. Note that these copy each solution.

If all you want is to print all the solutions, you can print a solution, 
and call fail to force backtracking to get the next solution; this is 
essentially what 'more' does..

 > 2. I have also an error in my code when I write : VitesseMaxi 
$::[400,450] in the following constraint :
 > (
 >                     (VitesseMaxi $= 600 , DistanceVol #::[800, 1000], 
ReservoirSupp #= 300);
 >                     (VitesseMaxi $::[400,450] , DistanceVol #= 1600, 
ReservoirSupp #= 300);
 >                     (VitesseMaxi $::[400,450] , DistanceVol #= 1400, 
ReservoirSupp #= 200);
 >                     (VitesseMaxi $= 550 , DistanceVol #:: [800,1000], 
ReservoirSupp #= 200);
 >                     (VitesseMaxi $= [450,400] , DistanceVol #= 1200, 
ReservoirSupp #= 100);
 >                     (VitesseMaxi $= 500 , DistanceVol #:: [800,1000], 
ReservoirSupp #= 100)
 > );

You didn't say which solver you are using, but you seem to be using ic.
The '$' variant of constraints (like $::) are for reals, and as the 
manual says, for reals, you have a real interval, i.e. a single 
contineous interval, and you cannot set  individual values like 400, 450
to such an interval (you can do that in a finite domain, where the 
domain consists of integer values, rather than a contineous interval).
Why are you using the $ variant of constraints for VitesseMaxi, when you 
actually assigning integer values to it?

Cheers,

Kish


-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.
Received on Thu Mar 04 2010 - 21:47:22 CET

This archive was generated by hypermail 2.3.0 : Tue Apr 16 2024 - 09:13:20 CEST