[eclipse-clp-users] how to generate *well-spaced* but accurate solutions using 'locate'

From: Solly Brown <sollyb_at_cse.unsw.edu.au>
Date: Sat, 25 Apr 2009 18:43:07 +1000
Hi all,

I have a question about the best way to use the 'locate' predicate in a 
real-valued domain where there are infinitely many solutions.

In my domain I want to find a limited number of solutions (say 10-20) 
which are well-spaced apart -- basically a 'representative sample' of 
the infinite number of solutions possible.

As a simple example, say I want to find positions (x,y) which lie on the 
circle x^2+y^2=5. Ideally, I want to be able to find a (semi-random) 
selection of solutions (say, 10 of them) spaced roughly evenly around 
the circle.

Using locate and backtracking doesn't work too well, because if I 
specify a high precision then it has a huge number of solutions to wade 
through. But if I lower the precision (in order to get fewer solutions) 
then the resulting solutions are too coarse (the range of values is too 
'approximate', and I need exact values).

So... any hints on the best way to tackle this problem? Should I attack 
this in a hierarchical fashion: find 10 solutions with a low precision 
value, and then run 'locate' again within these intervals at a higher 
precision value? Or is there a smarter way of doing it, or perhaps some 
builtin I have missed? I'm not terribly familiar with ECLiPSe so any 
advice would be greatly appreciated.

Thanks,

Solly
Received on Sat Apr 25 2009 - 08:58:29 CEST

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