def __init__(self, costs, t_s=1): """ Class constructor. Creates the dynamic cost, optionally using the specified sampling time `t_s`. Parameters ---------- costs : list The sequence of static costs. t_s : float, optional The sampling time, that is, the time that elapses between two consecutive costs. The default is 1. Notes ----- The costs are implicitly assumed to have the same domain and to be static. """ # create time domain time = sets.T(t_s, t_min=0, t_max=len(costs) * t_s) super().__init__(costs[0].dom, time) self.costs, self.N = costs, len(costs) self.smooth = min([c.smooth for c in costs])
def __init__(self, nets, t_s=1): """ Class constructor. Parameters ---------- nets : list A list of the networks over time. t_s : float, optional The time after which the network changes to the next configuration. """ # create time domain self.time = sets.T(t_s, t_min=0, t_max=len(nets)*t_s) # store networks self.nets, self.N = nets, len(nets)
def __init__(self, t_s, t_max): super().__init__(sets.R(2, 1), sets.T(t_s, t_max=t_max)) self.smooth = 2
def __init__(self, t_s, t_max, omega=0.02 * math.pi, kappa=7.5, mu=1.75): super().__init__(sets.R(), sets.T(t_s, t_max=t_max)) self.omega, self.kappa, self.mu = omega, kappa, mu self.smooth = 2