def getTrajectory(self): path = self.bestPath() ind, v = self.source.sparse() s=ind[argmax(v)] pts = [hg.hexItoXY(s, self.width, self.hexedge)] for i in path: t = self.transforms[i] for j in t: s = self.map[s, j] pts.append(hg.hexItoXY(s, self.width, self.hexedge)) return array(pts)
def plot(self, s): self.graph.plots={} w, e, b = self.alg.space self.graph.hexGridPlot(s, w, e, b, name='bias') self.graph.limits=array([-1,w*e+2, -1.0, .866*e*(s.shape[0]/w)+2]) loc = self.alg.current_location loc = hexItoXY(loc, w, e) print loc self.graph.markup(array([loc]), 'circle', int(max(15, min(s.shape)/50.))) self.graph.DrawAll()