Trees | Indices | Help |
|
---|
|
A Class in the classification scheme. Meant to be called only by Node in this module. N.B.: The term "item" is a synonym for a Class_ 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 Class_ |
children Children of the current Class_ (set by Scheme.registerItem()) |
||
Any object |
data Arbitrary data associated with an item (set by Scheme.registerItem()) |
||
str |
name Name of the current Class_ (set by Scheme.registerItem()) |
||
int |
nitems Number of items contained by the current Class_ (set by Scheme.setClassPopulations()) |
||
Node |
node Node to which the current Class_ belongs (set by Scheme.registerItem()) |
||
list of Class_ |
ordered_classes for the lowest-level Node, only, the full ordered class list for an item. |
||
set of Class_ |
parents Parents of the current Class_ (set by Scheme.registerItem()) |
|
Create a new class with the given name in the given node. It is assumed that the name has already been checked for uniqueness within the node.
|
Add the ordered class list to its item. This permits certain search optimizations.
|
Add a child to the current class.
|
Add a parent to the current class.
|
Get the set of items contained in the current class.
|
Get (up to) nwanted random items from the current class. If there are nwanted or fewer items in the class, 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 Class_, selecting more or less equally from Class_ children, recursively, at each level down to the items themselves. This avoids unbalanced random sampling in situations where some child classes contain many more items than others.
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Jan 10 20:54:36 2015 | http://epydoc.sourceforge.net |