[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
HierarchicalSocialEntropy class available (and U-Diametric Cluster class
From: |
Paul Johnson |
Subject: |
HierarchicalSocialEntropy class available (and U-Diametric Cluster class too) |
Date: |
Thu, 31 Aug 2000 11:18:12 -0500 |
Get it here:
http://lark.cc.ukans.edu/~pauljohn/Swarm/MySwarmCode/HierSocialEntropy-1.0.tar.gz
If I get any feedback, I'll do revisions and then send into Swarm's
contrib ftp.
An excerpt from HierSocialEntropy.h:
/*Copyright Paul Johnson <address@hidden> 2000, released under the
Gnu Public License. I offer no warranty of any kind for any purpose
with this code.
Hierarchical Social Entropy is a diversity measure proposed by
Tucker Balch. His articles on this are quite excellent and you should
read them if you want to use this class.
http://www.cs.cmu.edu/~trb/papers/
Here is an example of how I call this class from a ModelSwarm level:
double ent;
ent = [HierSocialEntropy calculate: self N: Xcoord+1 DissMatr:
distMatrix];
fprintf(stderr, "\n \n ent is %f \n", ent);
This is a class method (like NSelect in Swarm library). You don't have
to create any objects explicitly. The arguments are a Zone object, the
number of items on which diversity is being measured, and a
dissimilarity matrix.
You must supply a full
dissimilarity matrix, with 0's on the main diagonal and "redundant"
distance measures above and below the main diagonal, as in:
0 33.4 56.5 44.5
33.4 0 31.3 41.1
56.5 31.3 0 23.1
44.5 41.1 23.1 0
When you call this method, the HierSocialEntropy class creates
an instance of the class which carries out the U-Diametric Clustering
(UDiamCluster) and inside the UDiamCluster.m file, you will see I've
used a pretty big supporting class called "AVLSet". AVLSet is class
that uses the avl_tree library (a part of Swarm) to create an ordered
set. I did this because the Swarm docs for Ordered Set say
"If you need one of these objects, then either use a List or wait for
some other implementation." I have implemented almost all of the
methods for protocols used by Swarm's Set, so if you have need for an
ordered set class, feel free to use this AVLSet.)
*/
Paul Johnson
ps: Don't hate me because its beautiful :)
--
Paul E. Johnson email: address@hidden
Dept. of Political Science http://lark.cc.ukans.edu/~pauljohn
University of Kansas Office: (785) 864-9086
Lawrence, Kansas 66045 FAX: (785) 864-5700
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- HierarchicalSocialEntropy class available (and U-Diametric Cluster class too),
Paul Johnson <=