some question about eclipse 5.3 #47

From: Deze Zhao <dzhao_at_niksula.hut.fi>
Date: Thu 14 Mar 2002 11:22:56 PM GMT
Message-ID: <Pine.GSO.4.20.0203150031540.29419-100000@plague.cs.hut.fi>
Hello,

I am a student of Helsinki University of Technology. I have a code
usingI the :- lib(ic). of eclipse 5.3 #47, you are requested
kindly to tell me what wrong here? 

Was it cause by lib(ic) or my source code was wrong? 

For detail questions see the bottom of this e-mail please !!!

 
%
% ECLiPSe CODE: an exercise for buffer scheduling in Uplink of WCDMA
%
% DESCRIPTION:  A magic square of size NxM, square means the transmission
%               matrix, N is the Channels, the same as buffers too. 
%               M means the minimized transmission times.
%
%               Some interesting goals:

:- lib(ic).

%:- lib(fd).
%:- lib(ria).


cool(N,M) :-

        cputime(T0),
        solve(N,M),
        T is cputime - T0,
        % for telling how long time CPU used 
        writeln([T, 'seconds']).


solve(N,M) :-

        % N means user's number and M the transmission steps
        % setting for buffer_size       
        dim(Buffers,[N]),  
        %Buffers[1..N] :: 0..inf,

        ( for(I,1,1), param(Buffers) do 
        Buffers[I] #= 480,  %960 
        Buffers[I+1] #= 480, Buffers[I+2] #= 480,
        Buffers[I+3] #= 480, Buffers[I+4] #= 480

        ),
                    

        % setting for Gain_matrix
        dim(Gains,[N]), %Gains[1..N] :: 0.0..1.0,

        ( for(I,1,1), param(Gains) do
        Gains[I] *= 100000000.0, 
        Gains[I+1] *= 19753086.4, Gains[I+2] *= 0.987,
        Gains[I+3] *= 0.122, Gains[I+4] *= 0.122
  
        ),


        % setting for different SIR_Target groops  
        dim(Target_sir,[N]),

        ( for(I,1,1), param(Target_sir) do
        Target_sir[I] *= 3.16, 
        Target_sir[I+1] *= 3.16, Target_sir[I+2] *= 3.16,
        Target_sir[I+3] *= 3.16, Target_sir[I+4] *= 3.16
  
        ),

               
        magic(Buffers,Gains,Target_sir,N,M).


magic(Buffers,Gains,Target_sir,N,M) :-
                                                

                
        % making the transmission matrix, N users ans M steps
        dim(Square, [N,M]),                     
       
        % their transmitting range
        Square[1..N,1..M]::[0, 15, 30, 60, 120, 240, 480],

        Rows is Square[1..N,1..M],
        flatten(Rows, Vars),

        % decide the constrains for buffer volume

        (
            for(I,1,N), param(N,M, Square, Buffers)
        do

           %Sum is Buffers[I],

           %sum row I as the buffer constraint for user I
           Buffers[I] #=< sum(Square[I,1..M])  


        ),

     
     (
      for(I,1,M), param(N,M,Square,Buffers,Gains,Target_sir) 

      do
     

      ( for(J,1,N), foreach(U,Temp), param(I,M,N,Square,Target_sir) 

      do
        

  U *= Square[J,I]*Target_sir[J]/(Square[J,I]*Target_sir[J]+3840000.0)  

      ),
       

       %% my question, why it didn't work here?
       1.0 *>= sum(Temp),


      ( for(K,1,N), param(I,N,M,Temp,Gains,Square,Target_sir) do
        
        R3 *= Square[K,I]*Target_sir[K]/3840000.0,

        %% my qustion is below, why these two constraints didn't work?

        3.84*(R3/(R3+1))/((1-sum(Temp))*Gains[K]*25000000000.1) *>= 0.0,

        %% this one seemed be ok, but why above one didn't work? 
        3*Gains[K] *>= 3.84*(R3/(R3+1))/((1-sum(Temp))*25000000000.1)
       
      )

       
     ),
      

        % all constrains ended here
        % search strategy and assign the possible values

        %locate(Vars, 0.001),
        labeling(Vars),
          
        % results output here

        % print result the program finished here
        print_square(Square).   

print_square(Square) :-
        dim(Square, [N,M]),
        ( for(I,1,N), param(N,M,Square) do
            ( for(J,1,M), param(M,I,Square) do
                Field is Square[I,J],
                printf("%6d", Field)
            ), nl
        ), nl.

********************************************
the test result is below: 

ECLiPSe Constraint Logic Programming System [kernel]
Copyright Imperial College London and ICL
Certain libraries copyright Parc Technologies Ltd
GMP library copyright Free Software Foundation
Version 5.3 #47, Mon Jan 28 20:19 2002

[eclipse 1]: [mypp11].
ic_kernel.eco loaded traceable 0 bytes in 0.10 seconds
linearize.eco loaded traceable 0 bytes in 0.08 seconds
ic_constraints.eco loaded traceable 0 bytes in 0.36 seconds
ic_search.eco loaded traceable 0 bytes in 0.05 seconds
ic.eco     loaded traceable 0 bytes in 0.56 seconds
mypp11.ecl compiled traceable 2464 bytes in 0.58 seconds

Yes (0.59s cpu)
[eclipse 2]: cool(5,5).
lists.eco  loaded traceable 0 bytes in 0.04 seconds
     0     0     0     0   480
     0     0     0     0   480
     0     0     0     0   480
     0     0     0     0   480
     0     0     0     0   480

[0.65, seconds]


There are 1800 delayed goals. Do you want to see them? (y/n) 
More (0.66s cpu) ? 

*********************************************

my question is, if I got five 480, the constraint 1.0 *> sum(Temp) 

should not hold, in other words, sum(Temp) should be larger than 1.

and this constraint also shouldn't hold at the same time,
3.84*(R3/(R3+1))/((1-sum(Temp))*Gains[K]*25000000000.1) *>= 0.0,  

Was something wrong in my source code? or?

I am looking forward to receiving the message from you!


Best Regards,

---Deze Zhao.
Received on Thu Mar 14 23:23:09 2002

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:08:14 PM GMT GMT