def test_straight():
    vertices = [np.array([0, 1])]
    N = len(vertices); F = 100; M = 10
    l = 1; d = l*2e-3; epsilon = d*1e-4
    output = run(N, M, F, l, d, epsilon, test=True, initial_vertices=vertices)
    assert len(output["active_vertices"]) == 0
    assert len(output["animation_segments_index"]) == 51
Beispiel #2
0
def test_simultaneous_growing():  #powstają dziwne ścieżki oraz pętle
    vertices = [np.array([1, 1]), np.array([1, -1]), np.array([0.5, 0.5])]
    N = len(vertices)
    F = 100
    M = 10
    l = 1
    d = l * 2e-3
    epsilon = d * 1e-4
    output = run(N, M, F, l, d, epsilon, test=True, initial_vertices=vertices)
    assert len(output["active_vertices"]) == 0
    assert len(output["animation_segments_index"]) == 91
Beispiel #3
0
def test_cross():
    vertices = [np.array([1, 1]), np.array([1, -1]), np.array([1.74, 0])]
    N = len(vertices)
    F = 100
    M = 10
    l = 1
    d = l * 2e-3
    epsilon = d * 1e-4
    output = run(N, M, F, l, d, epsilon, test=True, initial_vertices=vertices)
    assert len(output["active_vertices"]) == 0
    assert len(output["animation_segments_index"]) == 102
Beispiel #4
0
def test_twoToPlay():
    vertices = [np.array([1, 1]), np.array([1, -1])]
    N = len(vertices)
    F = 100
    M = 10
    l = 1
    d = l * 2e-3
    epsilon = d * 1e-4
    output = run(N, M, F, l, d, epsilon, test=True, initial_vertices=vertices)
    assert len(output["active_vertices"]) == 0
    assert len(
        output["animation_segments_index"]
    ) == 102  # Docierają w różnych (o jeden) czasach przez wypustki. I tak samo wszędzie poniżej #Chyba już jest dobrze. W sumie to już nie wiem
Beispiel #5
0
def test_simultaneous_breach():  #jak wyżej
    vertices = [
        np.array([1, 1]),
        np.array([1, -1]),
        np.array([0.45, 0.5]),
        np.array([0.45, -0.5])
    ]
    N = len(vertices)
    F = 100
    M = 10
    l = 1
    d = l * 2e-3
    epsilon = d * 1e-4
    output = run(N, M, F, l, d, epsilon, test=True, initial_vertices=vertices)
    assert len(output["active_vertices"]) == 0
    assert len(output["animation_segments_index"]) == 82
Beispiel #6
0
def test_asymetricLoop():
    vertices = [np.array([0.5, 0])]
    segments = [(0, 0), (0.75, 0)]
    N = len(vertices)
    F = 100
    M = 10
    l = 1
    d = l * 2e-3
    epsilon = d * 1e-4
    output = run(N,
                 M,
                 F,
                 l,
                 d,
                 epsilon,
                 test=True,
                 initial_vertices=vertices,
                 initial_segments=segments)
    assert len(output["active_vertices"]) == 0
    assert len(output["segments"]) == 375
Beispiel #7
0
def test_lackOfLoopsCentered():
    vertices = [np.array([0, 1])]
    segments = [(0, 0), (2e-3, 0), (-2e-3, 0), (2 * 2e-3, 0), (-2 * 2e-3, 0)]
    N = len(vertices)
    F = 100
    M = 10
    l = 1
    d = l * 2e-3
    epsilon = d * 1e-4
    output = run(N,
                 M,
                 F,
                 l,
                 d,
                 epsilon,
                 test=True,
                 initial_vertices=vertices,
                 initial_segments=segments)
    assert len(output["active_vertices"]) == 0
    assert len(output["segments"]) == 504
Beispiel #8
0
def test_loopsVsMulti():  #dwie ścieżki nachodzą na siebie. Nie powoduje błędów
    vertices = [np.array([0.5, 0]), np.array([0.2, 0])]
    segments = [(0, 0), (0.75, 0)]
    N = len(vertices)
    F = 100
    M = 10
    l = 1
    d = l * 2e-3
    epsilon = d * 1e-4
    # breakpoint()
    output = run(N,
                 M,
                 F,
                 l,
                 d,
                 epsilon,
                 test=True,
                 initial_vertices=vertices,
                 initial_segments=segments)
    assert len(output["active_vertices"]) == 0
    assert len(output["segments"]) > 300
Beispiel #9
0
def test_unclosing():
    vertices = [np.array([0.5, 0]), np.array([-0.32, 0])]
    segments = [(0, 0), (0.75, 0)]
    N = len(vertices)
    F = 100
    M = 10
    l = 1
    d = l * 2e-3
    epsilon = d * 1e-4
    # breakpoint()
    output = run(N,
                 M,
                 F,
                 l,
                 d,
                 epsilon,
                 test=True,
                 initial_vertices=vertices,
                 initial_segments=segments)
    assert len(output["active_vertices"]) == 0
    assert len(output["segments"]) > 475