An arc-labeled tree where each node is uniquely described by a
sequence of all arc labels joining the root to that node. Some nodes are
*instanciated*, which means that they have an =instance= attribute. The
class provides several methods to get the most appropriate instance,
given a key.
|
|
__init__(self,
instance=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
source code
|
|
|
|
_getOrMakeChildren(self)
Return the dict of children, constructing it if necessary. |
source code
|
|
|
|
isEmpty(self)
Return True iff this ChoiceTree has no instanciated node. |
source code
|
|
|
|
set(self,
seq,
instance,
override=False)
Instanciate the node identified by =seq= with =instance=. |
source code
|
|
|
|
unset(self,
seq)
Uninstanciate the node at =seq=. |
source code
|
|
|
|
|
|
|
|
|
|
getAny(self,
_whereami=())
Search (depth first) the first instanciated node of this tree, and
return a tuple (seq, instance). |
source code
|
|
|
|
getAnySeq(self)
Search (depth first) the first instanciated node of this tree, and
return its identifying sequence. |
source code
|
|
|
|
getAnyInstance(self)
Search (depth first) the first instanciated node of this tree, and
return its instance. |
source code
|
|
|
|
getMostSpecific(self,
seq,
_default=None,
_whereami=())
Search for the most specific instanciated node in the path leadin to
the given =seq=, and return a tuple (seq, instance). |
source code
|
|
|
|
getMostSpecificSeq(self,
seq)
Search for the most specific instanciated node in the path leadin to
the given =seq=, and return its identifying sequence. |
source code
|
|
|
|
getMostSpecificInstance(self,
seq)
Search for the most specific instanciated node in the path leadin to
the given =seq=, and return its instance. |
source code
|
|
|
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__str__
|