------------------------------

Message: 9
Date: Sun, 1 Jul 2007 21:34:15 +0200
From: St?phane Ducasse <stephane.ducasse@univ-savoie.fr>
Subject: [Moose-dev]  distribution map in 6 lines?
To: Moose-dev Bugs <moose-dev@iam.unibe.ch>
Message-ID: <EA9BA9AA-35AF-4157-B64F-77C5E5E20381@univ-savoie.fr>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

       Andrea where can I find the distribution map code you show me (how
to write a distribution map in 6 lines of code

------------------------------

      Hi,

Presuming you were referring to me, it's Adrian and not Andrea :)
The code is in my bundle MoosLiDevelopment, but because it is only 3 lines i've extracted it below:

    | engine serializedCollection |

    engine := ClusterEngine with: aCollection using: distanceBlock.
    engine hierarchicalClusteringShowProgressUsing: #averageLinkage.
    serializedCollection := engine dendrogram collect: #yourself.

where:
aCollection: is your collection of elements you want to cluster
distanceBlock: is a block that returns the distance between any 2 elements of your collection (eg. Euclidean distance for numerical proprieties of elements)
serializedCollection := the result of the clustering, the serialized version of the collection

Sorry for the late answer, but i was away for a few days.

   Ciao,
   Adi


--
Adrian DOZSA
Politehnica University of Timisoara      
Computer Science Department
mail: adi.dozsa@gmail.com
web: http://adi.dozsa.googlepages.com/