def connect_z(r1, r2, v1, v2): c1 = LBConnection.make(v1, v2, self.Z_HIGH, grid) c2 = LBConnection.make(v2, v1, self.Z_LOW, grid) if c1 is None: return False r1._add_connection(self.Z_HIGH, ConnectionPair(c1, c2)) r2._add_connection(self.Z_LOW, ConnectionPair(c2, c1)) return True
def connect_z(r1, r2, v1, v2): c1 = LBConnection.make(v1, v2, self.Z_HIGH, grid) c2 = LBConnection.make(v2, v1, self.Z_LOW, grid) if c1 is None: return False r1._add_connection(self.Z_HIGH, ConnectionPair(c1, c2)) r2._add_connection(self.Z_LOW, ConnectionPair(c2, c1)) return True