Re: [eclipse-users] Use of max with ic_probing_for_scheduling

From: Kish Shen <kisshen_at_cisco.com>
Date: Fri, 13 Jul 2007 17:50:11 +0100
Hi David,

The problem is not with the max cost function. In the ex3 you are 
trying, you need to specify the MaxResource, the error message you are 
getting shows that the code expects this to be instantiated:

 >instantiation fault in =<(1, MaxResource) in module ic_make_overlap_bivs

I think MaxResource is the maximum number of resources that can be used 
at the same time, and this needs to be specified, as stated in the 
documentation:

probe_sched(+Starts, +Durations, +Resources, ++MaxResource, ?CostFun)

If you look at ex1 and ex2, you will see that this is instantiated to an 
integer before probe_sched/5 is called.


For example, with MaxResources = 3:

[eclipse 3]: ex3(S,3,C).
lists.eco  loaded traceable 0 bytes in 0.01 seconds
Found a solution with cost 8
probes(7)

S = [1, 3, 1, 4]
C = 8


Delayed goals:
        eplex : integers([8])
Yes (0.02s cpu)


Cheers,

Kish

David Norman wrote:
> Hi,
>  
> Can someone give me a working example of using max in a cost function 
> using the ic_probing_for_scheduling library?
>  
> The example ex3 in the documentation for the ic_probing_for_scheduling 
> documentation doesn't work for me in version 5.10 #77. 
>  
> Thanks,
> David
>  
>  
>  
> ex3(Starts,MaxResource,Cost) :-
>  Starts=[S1,S2,S3,S4],
>  ic:(S1::1..10),
>  ic:(S2::3..10),
>  ic:(S3::1..5),
>  ic:(S4::3..10),
>         [D1,D2,D3,D4]=[5,5,3,3],
>         Durations=[D1,D2,D3,D4],
>  Resources=[1,1,1,1],
>  CostFun= max([S1+D1,S2+D2,S3+D3,S4+D4]),
>  probe_sched(Starts,Durations,Resources,MaxResource,CostFun),
>  ic:(Cost =:= eval(CostFun)).
>     
>
> % eclipse -b ProbingForScheduling.ecl -e 'ex3(Starts, MaxResource, Cost)'
> loading OSI clpcbc ... done
> instantiation fault in =<(1, MaxResource) in module ic_make_overlap_bivs
> abort
>  
>  
>
> ------------------------------------------------------------------------
> Don't get caught with egg on your face.    Play Chicktionary!  
> <http://club.live.com/chicktionary.aspx?icid=chick_wlmailtextlink>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ECLiPSe-Users mailing list
> ECLiPSe-Users_at_crosscoreop.com
> http://www.crosscoreop.com/mailman/options/eclipse-users
>   
Received on Fri Jul 13 2007 - 17:50:25 CEST

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET