From d7d47326a50f75b3eb35d098d1e6f07558beca32 Mon Sep 17 00:00:00 2001 From: rzf Date: Fri, 2 May 2008 14:21:00 +0000 Subject: [PATCH] measuring time git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2229 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- cplint/lpadclpbn.pl | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/cplint/lpadclpbn.pl b/cplint/lpadclpbn.pl index 2f93287d1..37e35afc0 100644 --- a/cplint/lpadclpbn.pl +++ b/cplint/lpadclpbn.pl @@ -99,6 +99,38 @@ s(GL,P,Time1,Time2):- statistics(walltime,[_,WT1]), Time2 is WT1/1000 ). + +s(GoalsList,Prob,CPUTime1,CPUTime2,WallTime1,WallTime2):- + solve(GoalsList,Prob,CPUTime1,CPUTime2,WallTime1,WallTime2). + + +solve(GL,P,CPUTime1,CPUTime2,WallTime1,WallTime2):- + statistics(cputime,[_,_]), + statistics(walltime,[_,_]), + (setof(Deriv,find_deriv(GL,Deriv),LDup)-> + append_all(LDup,[],L), + remove_head(L,L1), + remove_duplicates(L1,L2), + statistics(cputime,[_,CT1]), + CPUTime1 is CT1/1000, + statistics(walltime,[_,WT1]), + WallTime1 is WT1/1000, + build_ground_lpad(L2,0,CL), + convert_to_clpbn(CL,GL,LV,P), + statistics(cputime,[_,CT2]), + CPUTime2 is CT2/1000, + statistics(walltime,[_,WT2]), + WallTime2 is WT2/1000 + ; + P=0.0, + statistics(cputime,[_,CT1]), + CPUTime1 is CT1/1000, + statistics(walltime,[_,WT1]), + WallTime1 is WT1/1000, + CPUTime2 =0.0, + statistics(walltime,[_,WT2]), + WallTime2 =0.0 + ),!. /* sc(GoalsList,EvidenceList,Prob) compute the probability of a list of goals GoalsList given EvidenceList. Both lists can have variables, sc returns in