Carl Mäsak wrote:
John (>):
I'm still in the dark... I find an positions for "manhattan distance" but no
definition of what that is.  I did find the alternative pod page earlier.

I don't have a whole answer for you, but a part that may help. What is
generally meant by "Manhattan distance" is so-called L1 distance, i.e.
Pythagoras' distance summation formula but without all the squaring
and surding.

 <http://en.wikipedia.org/wiki/Taxicab_geometry>

I imagine the concept is applied to parameter types in the discussion
in question.

To do multi method dispatch, you want to select the method that best matches the parameters in the call. One way to do that is to define a measure for distances between types and they use the method that's at the minimum distance. One simple measure is that a type is distance 0 from itself and distance 1 from it's immediate super-types, distance 2 from the immediate super-types of it's immediate super-types, etc. When dispatching over a single parameter picking the method at the minimum distance is the usual most specific type match. But when you want to do multi-method dispatch, you need some rule to combine the various distances of the individual parameters into a single measure value, then pick the method at the minimum distance by that combined measure. "Manhattan Distance" or "Taxicab Distance" is the rule that the combined distance is just the simple unweighted sum of the individual parameter distances. The is named after the fact that a taxi must follow the streets and to go 3 block north and 4 blocks west it must travel 7 blocks not the 5 blocks of the euclidean distance.

BTW, if you want to do euclidean distance comparisons you don't need to do any square roots. Square root is monotonic, so order relations between the sums of squares values is the the same whether you take square roots or not.


--
[EMAIL PROTECTED]
[EMAIL PROTECTED]

Reply via email to