Re: [eclipse-clp-users] eclipse problem

From: Marco Gavanelli <marco.gavanelli_at_...17...>
Date: Fri, 13 Aug 2010 09:58:00 +0200
On 06/08/10 21:58, paniz alipour wrote:
> Hi all
>
> this is the code of university time tabling ,my question is this
> I have 2 hard constraint,I want to know whether such red line codes are true
> or not

The lines in color (I corrected some param mistake) are

(
for(K,1,NRoom),param(T,Timeslots,NCourse)do
     (for(J,1,Timeslots),param(NCourse,T,K)do
          (for(I,1,NCourse),foreach(X,L), param(J,K,T) do
                subscript(T,[I,J,K],X)
           ),
      flatten(L,L1),
      sum(L1)#=<1	<-------
      )
),
  labeling(Vars)		<-------


What do you mean with "whether such red line codes are true or not"?
You could write

	(sum(L1)#=<1
		->	writeln("sum(L1)#=<1 is true")
		;	writeln("sum(L1)#=<1 is false")
	)

and the same for the line with labeling, but it does not make much sense 
(specially for the constraint).

After correcting the mistakes in the loops (see the warnings ECLiPSe 
gives you), the solve(T) goal succeeds, which means that all the 
sub-goals it contains have succeeded.

Cheers,
Marco

-- 
Marco Gavanelli, Ph.D. in Computer Science
Dept of Engineering
University of Ferrara
Tel/Fax  +39-0532-97-4833
http://www.ing.unife.it/docenti/MarcoGavanelli/
Received on Fri Aug 13 2010 - 07:58:09 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST