How to pass integer value?
Xiao-Hua Kong <[email protected]>
| Newsgroups | gmane.comp.gnu.prolog.general |
|---|---|
| Message-ID | <Pine.GSO.4.05.10409231251100.24490-100000@darmok> |
Hi, I have a question of passing an integer value between two CSP problems. I am using two FD programs: one gets a shreshold; the other uses the threshold to solve a CSP problem: ====================================================== req1(LD1,LD2,Thrsd):- LD1 = [A,B,C,D], LD2 = [E,F,G], .... A - F #=< Thrsd, .... fd_labeling(LD1), fd_labeling(LD2). ----------------------------------------------------------------------------------------------- check(LD1,LD2) :- LD1 = [X,Y,Z], LD2 = [M,N,L]. .... N*2 - M//4 #>= Thrsd, .... fd_labeling(LD1), fd_labeling(LD2). ====================================================== I use fd_minimize(Thresd) to find the threshold, then check if the second CSP has solution using this threshold. Now my question is how to pass the shreshold from one to another. I did not find such situation in FD examples. Can I use global vareiables? Any link to it? Is there any option other than fd_minimize(Var) I can use to find that threshold? Thanks Xiaohua ************************************************************************* Xiaohua Kong __ O_ Off. : (514)398-3937 Ph.D. Candidate // \ Fax : (514)636-8029 Microelectronics And // Computer System Laboratory O / Dept. of ECE ------ Email: [email protected] McGill University, Montreal ---- *************************************************************************