21.10.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

seed_same_trajectory_test.py 2.82 KB
Newer Older
1
2
import unittest
import pprint
3
from vadereanalysistool import SameSeedTrajectory
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64


class SameSeedTrajectoryTest(unittest.TestCase):

    def test_find_same_scenarios(self):
        test = SameSeedTrajectory("../../tests/testData/s2ucre")

        same_scenarios = test.find_same_scenarios()
        self.assertEqual(3, len(same_scenarios['774fc8aaaf93ee003709626bb4c0db1f']))
        self.assertEqual(2, len(same_scenarios['7be534d60a54f00afa1f9244466e8dcf']))
        self.assertEqual(2, len(same_scenarios['2b706a0ed12842f7ecfcc1b966b2edcc']))
        self.assertEqual(2, len(same_scenarios['925007d0e16f698f404ede36528bbf49']))

    def test_trajectory_seed(self):
        test = SameSeedTrajectory("../../tests/testData/s2ucre")
        out = test.get_trajectory_comparison_result()
        self.assertEqual(9, len(out))
        pprint.pprint(out)

        bridge_coordinates_kai = out[0]
        self.assertEqual(False, bridge_coordinates_kai['hash_is_equal'])
        self.assertEqual(3, len(bridge_coordinates_kai['scenario_outputs']))

        bridge_coordinates_kai_navigation = out[1]
        self.assertEqual(True, bridge_coordinates_kai_navigation['hash_is_equal'])
        self.assertEqual(2, len(bridge_coordinates_kai_navigation['scenario_outputs']))

        bridge_coordinates_kai_navigation_random_pos = out[2]
        self.assertEqual(True, bridge_coordinates_kai_navigation_random_pos['hash_is_equal'])
        self.assertEqual(2, len(bridge_coordinates_kai_navigation_random_pos['scenario_outputs']))

        bridge_coordinates_kai_origin_0 = out[3]
        self.assertEqual(True, bridge_coordinates_kai_origin_0['hash_is_equal'])
        self.assertEqual(2, len(bridge_coordinates_kai_origin_0['scenario_outputs']))


        bridge_coordinates_kai_origin_0_navigation = out[4]
        self.assertEqual(True, bridge_coordinates_kai_origin_0_navigation['hash_is_equal'])
        self.assertEqual(2, len(bridge_coordinates_kai_origin_0_navigation['scenario_outputs']))


        bridge_coordinates_kai_origin_0_navigation_random_pos = out[5]
        self.assertEqual(True, bridge_coordinates_kai_origin_0_navigation_random_pos['hash_is_equal'])
        self.assertEqual(2, len(bridge_coordinates_kai_origin_0_navigation_random_pos['scenario_outputs']))


        bridge_coordinates_kai_origin_0_random_pos = out[6]
        self.assertEqual(True, bridge_coordinates_kai_origin_0_random_pos['hash_is_equal'])
        self.assertEqual(2, len(bridge_coordinates_kai_origin_0_random_pos['scenario_outputs']))


        bridge_coordinates_kai_random_pos = out[7]
        self.assertEqual(True, bridge_coordinates_kai_random_pos['hash_is_equal'])
        self.assertEqual(2, len(bridge_coordinates_kai_random_pos['scenario_outputs']))


        empty = out[8]
        self.assertEqual(True, empty['hash_is_equal'])
        self.assertEqual(2, len(empty['scenario_outputs']))