Revision 62798f6e mrai_setter/test_mrai_setter.py

View differences:

mrai_setter/test_mrai_setter.py
12 12
    @classmethod
13 13
    def setup_class(cls):
14 14
        cls.small_saw = nx.Graph()
15
        cls.small_saw.add_edge('x1', 'x2', type='transit', customer='x2')
16
        cls.small_saw.add_edge('x2', 'x3', type='transit', customer='x3')
15
        cls.small_saw.add_edge('x1', 'x2', type='transit', customer='x1')
16
        cls.small_saw.add_edge('x2', 'x3', type='transit', customer='x2')
17 17

  
18
        cls.small_saw.add_edge('x1', 'y1', type='transit', customer='y1')
19
        cls.small_saw.add_edge('y1', 'x2', type='transit', customer='x2')
20
        cls.small_saw.add_edge('x2', 'y2', type='transit', customer='y2')
21
        cls.small_saw.add_edge('y2', 'x3', type='transit', customer='x3')
18
        cls.small_saw.add_edge('x1', 'y1', type='transit', customer='x1')
19
        cls.small_saw.add_edge('y1', 'x2', type='transit', customer='y1')
20
        cls.small_saw.add_edge('x2', 'y2', type='transit', customer='x2')
21
        cls.small_saw.add_edge('y2', 'x3', type='transit', customer='y2')
22 22

  
23 23
        cls.saw = nx.Graph()
24
        cls.saw.add_edge('x1', 'x2', type='transit', customer='x2')
25
        cls.saw.add_edge('x2', 'x3', type='transit', customer='x3')
26
        cls.saw.add_edge('x3', 'x4', type='transit', customer='x4')
24
        cls.saw.add_edge('x1', 'x2', type='transit', customer='x1')
25
        cls.saw.add_edge('x2', 'x3', type='transit', customer='x2')
26
        cls.saw.add_edge('x3', 'x4', type='transit', customer='x3')
27 27

  
28
        cls.saw.add_edge('x1', 'y1', type='transit', customer='y1')
29
        cls.saw.add_edge('y1', 'x2', type='transit', customer='x2')
30
        cls.saw.add_edge('x2', 'y2', type='transit', customer='y2')
31
        cls.saw.add_edge('y2', 'x3', type='transit', customer='x3')
32
        cls.saw.add_edge('x3', 'y3', type='transit', customer='y3')
33
        cls.saw.add_edge('y3', 'x4', type='transit', customer='x4')
28
        cls.saw.add_edge('x1', 'y1', type='transit', customer='x1')
29
        cls.saw.add_edge('y1', 'x2', type='transit', customer='y1')
30
        cls.saw.add_edge('x2', 'y2', type='transit', customer='x2')
31
        cls.saw.add_edge('y2', 'x3', type='transit', customer='y2')
32
        cls.saw.add_edge('x3', 'y3', type='transit', customer='x3')
33
        cls.saw.add_edge('y3', 'x4', type='transit', customer='y3')
34 34

  
35 35
        cls.chain = nx.Graph()
36
        cls.chain.add_edge('x1', 'x2', type='transit', customer='x2')
37
        cls.chain.add_edge('x2', 'x3', type='transit', customer='x3')
38
        cls.chain.add_edge('x3', 'x4', type='transit', customer='x4')
39

  
40
        cls.chain.add_edge('x1', 'y12', type='transit', customer='y12')
41
        cls.chain.add_edge('y12', 'y11', type='transit', customer='y11')
42
        cls.chain.add_edge('y11', 'y10', type='transit', customer='y10')
43
        cls.chain.add_edge('y10', 'x2', type='transit', customer='x2')
44

  
45
        cls.chain.add_edge('x1', 'z13', type='transit', customer='z13')
46
        cls.chain.add_edge('z13', 'y12', type='transit', customer='y12')
47
        cls.chain.add_edge('y12', 'z12', type='transit', customer='z12')
48
        cls.chain.add_edge('z12', 'y11', type='transit', customer='y11')
49
        cls.chain.add_edge('y11', 'z11', type='transit', customer='z11')
50
        cls.chain.add_edge('z11', 'y10', type='transit', customer='y10')
51
        cls.chain.add_edge('y10', 'z10', type='transit', customer='z10')
52
        cls.chain.add_edge('z10', 'x2', type='transit', customer='x2')
53

  
54
        cls.chain.add_edge('x2', 'y22', type='transit', customer='y22')
55
        cls.chain.add_edge('y22', 'y21', type='transit', customer='y21')
56
        cls.chain.add_edge('y21', 'y20', type='transit', customer='y20')
57
        cls.chain.add_edge('y20', 'x3', type='transit', customer='x3')
58

  
59
        cls.chain.add_edge('x2', 'z23', type='transit', customer='z23')
60
        cls.chain.add_edge('z23', 'y22', type='transit', customer='y22')
61
        cls.chain.add_edge('y22', 'z22', type='transit', customer='z22')
62
        cls.chain.add_edge('z22', 'y21', type='transit', customer='y21')
63
        cls.chain.add_edge('y21', 'z21', type='transit', customer='z21')
64
        cls.chain.add_edge('z21', 'y20', type='transit', customer='y20')
65
        cls.chain.add_edge('y20', 'z20', type='transit', customer='z20')
66
        cls.chain.add_edge('z20', 'x3', type='transit', customer='x3')
67

  
68
        cls.chain.add_edge('x3', 'y32', type='transit', customer='y32')
69
        cls.chain.add_edge('y32', 'y31', type='transit', customer='y31')
70
        cls.chain.add_edge('y31', 'y30', type='transit', customer='y30')
71
        cls.chain.add_edge('y30', 'x4', type='transit', customer='x4')
72

  
73
        cls.chain.add_edge('x3', 'z33', type='transit', customer='z33')
74
        cls.chain.add_edge('z33', 'y32', type='transit', customer='y32')
75
        cls.chain.add_edge('y32', 'z32', type='transit', customer='z32')
76
        cls.chain.add_edge('z32', 'y31', type='transit', customer='y31')
77
        cls.chain.add_edge('y31', 'z31', type='transit', customer='z31')
78
        cls.chain.add_edge('z31', 'y30', type='transit', customer='y30')
79
        cls.chain.add_edge('y30', 'z30', type='transit', customer='z30')
80
        cls.chain.add_edge('z30', 'x4', type='transit', customer='x4')
36
        cls.chain.add_edge('x1', 'x2', type='transit', customer='x1')
37
        cls.chain.add_edge('x2', 'x3', type='transit', customer='x2')
38
        cls.chain.add_edge('x3', 'x4', type='transit', customer='x3')
39

  
40
        cls.chain.add_edge('x1', 'y12', type='transit', customer='x1')
41
        cls.chain.add_edge('y12', 'y11', type='transit', customer='y12')
42
        cls.chain.add_edge('y11', 'y10', type='transit', customer='y11')
43
        cls.chain.add_edge('y10', 'x2', type='transit', customer='y10')
44

  
45
        cls.chain.add_edge('x1', 'z13', type='transit', customer='x1')
46
        cls.chain.add_edge('z13', 'y12', type='transit', customer='z13')
47
        cls.chain.add_edge('y12', 'z12', type='transit', customer='y12')
48
        cls.chain.add_edge('z12', 'y11', type='transit', customer='z12')
49
        cls.chain.add_edge('y11', 'z11', type='transit', customer='y11')
50
        cls.chain.add_edge('z11', 'y10', type='transit', customer='z11')
51
        cls.chain.add_edge('y10', 'z10', type='transit', customer='y10')
52
        cls.chain.add_edge('z10', 'x2', type='transit', customer='z10')
53

  
54
        cls.chain.add_edge('x2', 'y22', type='transit', customer='x2')
55
        cls.chain.add_edge('y22', 'y21', type='transit', customer='y22')
56
        cls.chain.add_edge('y21', 'y20', type='transit', customer='y21')
57
        cls.chain.add_edge('y20', 'x3', type='transit', customer='y20')
58

  
59
        cls.chain.add_edge('x2', 'z23', type='transit', customer='x2')
60
        cls.chain.add_edge('z23', 'y22', type='transit', customer='z23')
61
        cls.chain.add_edge('y22', 'z22', type='transit', customer='y22')
62
        cls.chain.add_edge('z22', 'y21', type='transit', customer='z22')
63
        cls.chain.add_edge('y21', 'z21', type='transit', customer='y21')
64
        cls.chain.add_edge('z21', 'y20', type='transit', customer='z21')
65
        cls.chain.add_edge('y20', 'z20', type='transit', customer='y20')
66
        cls.chain.add_edge('z20', 'x3', type='transit', customer='z20')
67

  
68
        cls.chain.add_edge('x3', 'y32', type='transit', customer='x3')
69
        cls.chain.add_edge('y32', 'y31', type='transit', customer='y32')
70
        cls.chain.add_edge('y31', 'y30', type='transit', customer='y31')
71
        cls.chain.add_edge('y30', 'x4', type='transit', customer='y30')
72

  
73
        cls.chain.add_edge('x3', 'z33', type='transit', customer='x3')
74
        cls.chain.add_edge('z33', 'y32', type='transit', customer='z33')
75
        cls.chain.add_edge('y32', 'z32', type='transit', customer='y32')
76
        cls.chain.add_edge('z32', 'y31', type='transit', customer='z32')
77
        cls.chain.add_edge('y31', 'z31', type='transit', customer='y31')
78
        cls.chain.add_edge('z31', 'y30', type='transit', customer='z31')
79
        cls.chain.add_edge('y30', 'z30', type='transit', customer='y30')
80
        cls.chain.add_edge('z30', 'x4', type='transit', customer='z30')
81 81

  
82 82
    def test_fabrikant_levels(self):
83 83
        levels = pg.fabrikant_levels(self.small_saw, 'x1')

Also available in: Unified diff