예제 #1
0
 def __init__(self, degree):
     msg = "degree %d is outside of mesh bounds" % degree
     InvalidDegree.__init__(self, msg)
예제 #2
0
 def unlink(self, degree, wid, border_id):
     if degree < 1:
         raise InvalidDegree("smallest wisps have no neighbors")
     self._borders[degree][wid].remove(border_id)
     self._regions[degree - 1][border_id].remove(wid)
예제 #3
0
 def nb_regions(self, degree, wid):
     if degree >= self.degree():
         raise InvalidDegree("biggest wisps do not separate regions")
     return len(self._regions[degree][wid])
예제 #4
0
 def regions(self, degree, wid, offset=1):
     if (degree + offset) > self.degree():
         raise InvalidDegree("biggest wisps do not separate regions")
     return self._regions_with_offset(degree, [wid], offset)
예제 #5
0
 def nb_borders(self, degree, wid):
     if degree < 1:
         raise InvalidDegree("smallest wisps have no borders")
     return len(self._borders[degree][wid])
예제 #6
0
 def borders(self, degree, wid, offset=1):
     if degree - offset < 0:
         raise InvalidDegree("smallest wisps have no borders")
     return self._borders_with_offset(degree, [wid], offset)
예제 #7
0
 def __init__ (self, degree) :
     InvalidDegree.__init__(self,"degree %d is outside of mesh bounds" % degree)