I'm working on a prolog program (CLPFD) with ECLiPSe 6.1. The program has a lot of variables and i want to minimize a certain value but (obviously) the minimization steps takes a lot of time. How can i print each solution found during the minimize phase? The output prints only (for instance) Found a solution with cost 22003482
but not the solution itself. I would like to have:
Found a solution with cost 22003482
L = [[...],[...],...,[]] %L is the list of value to minimize
on each step of the minimization process.
I've tried this approach:
myLabeling([]).
myLabeling([H|T]):-
labeling(H),
myLabeling(T).
%code for the problem
%timeout(+Goal, ++TimeLimit, +TimeOutGoal)
timeout(minimize(myLabeling(AllNodesList),Result),TimeLimit,
myLabeling(AllNodesList)).
where AllNodesList
is a list of lists and TimeOutGoal
is the goal to run when TimeLimit
expires. This solution doesn't print the last solution found but the first non optimized solution found with labeling.
Any suggestions? Thanks.