| Home | Trees | Indices | Help |
|---|
|
|
Basic chart edge data structure.
mother_cat: the catgeory (being) built
first_cat: the next category needed
equal to '*completed*' for completed edges
rest_cats: the list of additional categories needed to
build a mother_cat
start: the starting index of the edge
Note that there is no end attribute because edges are indexed
by their ends, hence always retrieved in sets ending at the same
index.
To create edge e1 ending (anywhere) starting at start, building
mother cat mather_cat with first needed cat first_cat and
additional needed cats rest_cats:
e1 = chart_edge_info(first_cat,rest_cats,mother_cat,start)
To display e1: e1.display()
To test if e1 is incomplete: e1.incomplete()
To test if e2 and e1 are equivalent: e1 == e2
: e1.__eq__(e2)
To test if an edge equivalent to e1 occurs in list L:
e1 in L
To find the index of an edge equivalent to e1 in list L:
L.index(e1)
Note: Raises ValueError if L contains no such edge.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Playing with fire. __hash__ must be defined for any object instances for which __eq__ is defined, if these object instances are to be used as dictionary keys. chart_edge_info instances are of course used as keys by dtr_dict. Restriction: Only one edge per edge equivalence class is ever thus used, which restriction is enforced by add_edge, so edge number is a safe key. I think. Alternative key: (self.mother_cat,self.first_cat,str(self.start))+tuple(self.rest_cats) |
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Mon May 11 10:49:20 2009 | http://epydoc.sourceforge.net |