Wayne Mac Adams wrote: > It might be a seperate issue but I am getting an unexpected result from the > following query also (again assuming ic loaded) > > ?- [A, B] :: 0.0 .. 0.5, C $= A + B, Cost $= -(C), minimize((locate([A, B, > C], 1.0), get_min(Cost, Min)), Min). > A = A{0.0 .. 0.5} > B = B{0.0 .. 0.5} > C = C{0.0 .. 0.5} > Cost = Cost{-0.5 .. -0.0} > Min = -0.5 > There are 2 delayed goals. > Yes (0.00s cpu) > > Surely the maximum for C is 1.0, and there should be a solution with Cost > -1.0? > > Am I simply using minimize wrong, or is there another problem? > Hi Wayne, There is no minimize/2 in lib(ic), and if you were using lib(branch_and_bound)'s minimize/2, you have not shown what it prints out with the query you gave: Found a solution with cost -0.5 Found no solution with cost -1.0Inf .. -1.5 notice that the interval between -0.5 and -1.5 was not covered -- this should give you the clue to the problem. If you read the documentation, you will see that miimize/2 is a short-hand for bb_min/3, with no options (i.e. run everything with the default). One of the option is delta, i.e. the minimum absolute improvement required for each step, and the default value is 1.0. Thus, after finding a solution of -0.5, it will only try to find a solution that is at least -1.5, so there is no better solution is found. Change your query to use bb_min, with a delta option, e.g. [A,B]:: 0.0..0.5, C $= A + B, Cost $= -C, bb_min((locate([A,B,C], 1.0), get_min(Cost, Min)), Min, bb_options{delta:0.5}). and this will give you Min = -1.0 `solution' [as Joachim pointed out, this is strictly not a solution, because you still have delayed goals and uninstantiated variables] Cheers, Kish -- This e-mail may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply e-mail and delete all copies of this message. Cisco Systems Limited (Company Number: 02558939), is registered in England and Wales with its registered office at 1 Callaghan Square, Cardiff, South Glamorgan CF10 5BT.Received on Mon Jul 27 2009 - 15:23:03 CEST
This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET