Trees | Indices | Help |
|
---|
|
A Partition in the hierarchy. Meant to be called only by Partitioning in this module. N.B.: The term "item" is a synonym for a Partition object at the lowest level of the hierarchy.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
set of items |
|
||
set of items |
|
||
set of items |
|
||
|
|
|||
int |
NO_FILL = 0 Do not diverge from equal child sampling in an attempt to return nwanted items; see getDiverseRandomItems().
|
||
int |
PART_FILL = 1 Mildly diverge from equal child sampling in an attempt to return nwanted items; see getDiverseRandomItems().
|
||
int |
FULL_FILL = 2 Strongly diverge from equal child sampling in an attempt to return nwanted items; see getDiverseRandomItems().
|
|
|||
set of Partition |
children Children of the current Partition (set by Hierarchy.registerItem()) |
||
Any object |
data Arbitrary data associated with an item (set by Hierarchy.registerItem()) |
||
str |
name Name of the current Partition (set by Hierarchy.registerItem()) |
||
int |
nitems Number of items contained by the current Partition (set by Hierarchy.setPartitionPopulations()) |
||
list of Partition |
ordered_partitions for the lowest-level Partitioning, only, the full ordered partition list for an item. |
||
set of Partition |
parents Parents of the current Partition (set by Hierarchy.registerItem()) |
||
Partitioning |
partitioning Partitioning to which the current Partition belongs (set by Hierarchy.registerItem()) |
|
Create a new partition with the given name in the given partitioning. It is assumed that the name has already been checked for uniqueness within the partitioning.
|
Add the ordered partition list to its item. This permits certain search optimizations.
|
Add a child to the current partition.
|
Add a parent to the current partition.
|
Get the set of items contained in the current partition.
|
Get (up to) nwanted random items from the current partition. If there are nwanted or fewer items in the partition, return them all.
|
Worker function to implement the recursive part of the method invoked by getDiverseRandomItems. See that method's description for details. |
Get (up to) nwanted random items from a Partition, selecting more or less equally from Partition children, recursively, at each level down to the items themselves. This avoids unbalanced random sampling in situations where some child partitions contain many more items than others.
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Aug 6 04:50:27 2015 | http://epydoc.sourceforge.net |