def diffeoaction_comm_distance(a1, a2, action_distance):
    """ 
        Returns the commutation-distance between two DiffeoActions
        which is d(a1a2, a2a1).
    """
    a1a2 = DiffeoAction.compose(a1, a2)
    a2a1 = DiffeoAction.compose(a2, a1)
    return action_distance(a1a2, a2a1)
def diffeoaction_comm_distance(a1, a2, action_distance):
    """ 
        Returns the commutation-distance between two DiffeoActions
        which is d(a1a2, a2a1).
    """
    a1a2 = DiffeoAction.compose(a1, a2)
    a2a1 = DiffeoAction.compose(a2, a1)
    return action_distance(a1a2, a2a1)
def diffeosystem_display_products(dds, report, nsteps):
    # XXX: make separate
    for i, a in enumerate(dds.actions):
        f = report.figure('cmd%s' % i, cols=nsteps)
        A = a
        for k in range(nsteps):
            A = DiffeoAction.compose(A, a)
            rgb = A.get_diffeo2d_forward().get_rgb_info()
            f.data_rgb('%s_%s' % (i, k), rgb)
def diffeosystem_display_products(dds, report, nsteps):
    # XXX: make separate
    for i, a in enumerate(dds.actions):
        f = report.figure('cmd%s' % i, cols=nsteps)
        A = a
        for k in range(nsteps):
            A = DiffeoAction.compose(A, a)
            rgb = A.get_diffeo2d_forward().get_rgb_info()
            f.data_rgb('%s_%s' % (i, k), rgb)
Esempio n. 5
0
    def compute_action(self, plan):
        if len(plan) == 0:
            shape = self.dds.actions[0].diffeo.get_shape()
            identity_cmd = np.array([0, 0])
            return DiffeoAction.identity('id', shape, identity_cmd)  # XXX

        last = self.dds.actions[plan[-1]]
        if len(plan) == 1:
            return last
        else:
            rest = self.compute_action(plan[:-1])
            return DiffeoAction.compose(last, rest)
Esempio n. 6
0
 def compute_action(self, plan):
     if len(plan) == 0:
         shape = self.dds.actions[0].diffeo.get_shape()
         identity_cmd = np.array([0, 0])
         return DiffeoAction.identity('id', shape, identity_cmd)  # XXX
     
     last = self.dds.actions[plan[-1]]
     if len(plan) == 1:
         return last
     else:
         rest = self.compute_action(plan[:-1])
         return DiffeoAction.compose(last, rest)