-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathproc_add_edge_visit_to_route.scs
140 lines (113 loc) · 4.92 KB
/
proc_add_edge_visit_to_route.scs
1
2
3
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
//Добавляет посещение ребра _edge и инцидентные ему вершины в маршрут _route.
proc_add_edge_visit_to_route
=> nrel_main_idtf:
[Добавляет посещение ребра _edge и инцидентные ему вершины в маршрут _route] (* <- lang_ru;; *);
[Add edge and vertex in path] (* <- lang_en;; *);
<- scp_program;
-> rrel_key_sc_element: .._process1;;
proc_add_edge_visit_to_route = [*
.._process1
_<- scp_process;
_-> rrel_1:: rrel_in:: .._route;
_-> rrel_2:: rrel_in:: .._edge;
_-> rrel_3:: rrel_in:: .._from_vertex;
_-> rrel_4:: rrel_in:: .._to_vertex;
_-> rrel_5:: rrel_out:: .._edge_visit;
_<= nrel_decomposition_of_action:: .._actions (*
_-> rrel_1:: .._proc_add_edge_visit_to_route_operator1 (*
_<- call;;
_-> rrel_1:: rrel_fixed:: rrel_scp_const:: proc_get_route_struct;;
_-> rrel_2:: rrel_fixed:: rrel_scp_const:: .._params1 (*
_-> rrel_1:: rrel_fixed:: rrel_scp_const:: .._route;;
_-> rrel_2:: rrel_assign:: rrel_scp_var:: .._route_struct;;
*);;
_-> rrel_3:: rrel_assign:: rrel_scp_var:: .._descr;;
_=> nrel_goto:: .._proc_add_edge_visit_to_route_operator2;;
*);;
_-> .._proc_add_edge_visit_to_route_operator2 (*
_<-waitReturn;;
_-> rrel_1:: rrel_fixed:: rrel_scp_var:: .._descr;;
_=> nrel_goto:: .._proc_add_edge_visit_to_route_operator3;;
*);;
// Находим отношение соответствия маршрута
//
_-> .._proc_add_edge_visit_to_route_operator3 (*
_<- call;;
_-> rrel_1:: rrel_fixed:: rrel_scp_const:: proc_get_route_visit;;
_-> rrel_2:: rrel_fixed:: rrel_scp_const:: .._params2 (*
_-> rrel_1:: rrel_fixed:: rrel_scp_const:: .._route;;
_-> rrel_2:: rrel_assign:: rrel_scp_var:: .._route_visit;;
*);;
_-> rrel_3:: rrel_assign:: rrel_scp_var:: .._descr;;
_=> nrel_goto:: .._proc_add_edge_visit_to_route_operator4;;
*);;
_-> .._proc_add_edge_visit_to_route_operator4 (*
_<-waitReturn;;
_-> rrel_1:: rrel_fixed:: rrel_scp_var:: .._descr;;
_=> nrel_goto:: .._proc_add_edge_visit_to_route_operator5;;
*);;
// Добавим посещение вершины _from_vertex в маршрут
//
_-> .._proc_add_edge_visit_to_route_operator5 (*
_<- call;;
_-> rrel_1:: rrel_fixed:: rrel_scp_const:: proc_add_vertex_visit_to_route;;
_-> rrel_2:: rrel_fixed:: rrel_scp_const:: .._params3 (*
_-> rrel_1:: rrel_fixed:: rrel_scp_const:: .._route;;
_-> rrel_2:: rrel_fixed:: rrel_scp_const:: .._from_vertex;;
_-> rrel_3:: rrel_assign:: rrel_scp_var:: .._from_vertex_visit;;
*);;
_-> rrel_3:: rrel_assign:: rrel_scp_var:: .._descr;;
_=> nrel_goto:: .._proc_add_edge_visit_to_route_operator6;;
*);;
_-> .._proc_add_edge_visit_to_route_operator6 (*
_<- waitReturn;;
_-> rrel_1:: rrel_fixed:: rrel_scp_var:: .._descr;;
_=> nrel_goto:: .._proc_add_edge_visit_to_route_operator7;;
*);;
//Получаем посещение вершины _to_vertex.
//
_-> .._proc_add_edge_visit_to_route_operator7 (*
_<- searchElStr5;;
_-> rrel_1:: rrel_assign:: rrel_scp_var:: .._to_vertex_visit;;
_-> rrel_2:: rrel_assign:: rrel_common:: rrel_scp_var:: .._arc2;;
_-> rrel_3:: rrel_fixed:: rrel_scp_const:: .._to_vertex;;
_-> rrel_4:: rrel_assign:: rrel_pos_const_perm:: rrel_scp_var:: .._arc4;;
_-> rrel_5:: rrel_fixed:: rrel_scp_var:: .._route_visit;;
_=> nrel_goto:: .._proc_add_edge_visit_to_route_operator8;;
*);;
// Создаём посещение дуги...
//
_-> .._proc_add_edge_visit_to_route_operator8 (*
_<- genElStr3;;
_-> rrel_1:: rrel_fixed:: rrel_scp_var:: .._from_vertex_visit;;
_-> rrel_2:: rrel_assign:: rrel_common:: rrel_scp_var:: .._edge_visit;;
_-> rrel_3:: rrel_fixed:: rrel_scp_var:: .._to_vertex_visit;;
_=> nrel_goto:: .._proc_add_edge_visit_to_route_operator9;;
*);;
// Добавим её в структуру маршрута.
//
_-> .._proc_add_edge_visit_to_route_operator9 (*
_<- genElStr5;;
_-> rrel_1:: rrel_fixed:: rrel_scp_var:: .._route_struct;;
_-> rrel_2:: rrel_assign:: rrel_pos_const_perm:: rrel_scp_var:: .._arc2;;
_-> rrel_3:: rrel_fixed:: rrel_scp_var:: .._edge_visit;;
_-> rrel_4:: rrel_assign:: rrel_pos_const_perm:: rrel_scp_var:: .._arc4;;
_-> rrel_5:: rrel_fixed:: rrel_scp_const:: rrel_arc;;
_=> nrel_goto:: .._proc_add_edge_visit_to_route_operator10;;
*);;
// Укажем, что _edge_visit является посещением edge
//
_-> .._proc_add_edge_visit_to_route_operator10 (*
_<- genElStr5;;
_-> rrel_1:: rrel_fixed:: rrel_scp_var:: .._edge_visit;;
_-> rrel_2:: rrel_assign:: rrel_common:: rrel_scp_var:: .._arc2;;
_-> rrel_3:: rrel_fixed:: rrel_scp_const:: .._edge;;
_-> rrel_4:: rrel_assign:: rrel_pos_const_perm:: rrel_scp_var:: .._arc4;;
_-> rrel_5:: rrel_fixed:: rrel_scp_var:: .._route_visit;;
_=> nrel_goto:: .._proc_add_edge_visit_to_route_operator_return;;
*);;
_-> .._proc_add_edge_visit_to_route_operator_return (*
_<- return;;
*);;
*);;
*];;