Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 46d2424b1be38309205218ae6cd6c03473d7cf06 (plain) (blame)
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
RoomModel MassiveMultiThreading {

	import room.basic.types.* from "Types.room"

	LogicalSystem LS {
		SubSystemRef sys1: SubSys
	}

	SubSystemClass SubSys {
		ActorRef tester: Tester
		ActorRef fork: Fork
		ActorRef redirect1: Redirect
		ActorRef redirect2: Redirect
		ActorRef redirect3: Redirect
		ActorRef redirect4: Redirect
		ActorRef redirect5: Redirect
		ActorRef redirect6: Redirect
		ActorRef redirect7: Redirect
		ActorRef redirect8: Redirect
		ActorRef redirect9: Redirect
		ActorRef redirect10: Redirect
		ActorRef join: Join
		ActorRef supervisor: Supervisor
		Binding tester.outport and fork.inport
		Binding tester.inport and join.outport
		Binding supervisor.application and join.security
		Binding fork.broadcast and redirect1.inport
		Binding fork.broadcast and redirect2.inport
		Binding fork.broadcast and redirect3.inport
		Binding fork.broadcast and redirect4.inport
		Binding fork.broadcast and redirect5.inport
		Binding fork.broadcast and redirect6.inport
		Binding fork.broadcast and redirect7.inport
		Binding fork.broadcast and redirect8.inport
		Binding fork.broadcast and redirect9.inport
		Binding fork.broadcast and redirect10.inport
		Binding join.inport and redirect1.outport
		Binding join.inport and redirect2.outport
		Binding join.inport and redirect3.outport
		Binding join.inport and redirect4.outport
		Binding join.inport and redirect5.outport
		Binding join.inport and redirect6.outport
		Binding join.inport and redirect7.outport
		Binding join.inport and redirect8.outport
		Binding join.inport and redirect9.outport
		Binding join.inport and redirect10.outport
		
		LogicalThread logical_thread2
		LogicalThread logical_thread1
		LogicalThread logical_thread3
		LogicalThread logical_thread4

		ActorInstanceMapping tester -> logical_thread1
		ActorInstanceMapping fork -> logical_thread2
		ActorInstanceMapping redirect1 -> logical_thread2
		ActorInstanceMapping redirect2 -> logical_thread3
		ActorInstanceMapping join -> logical_thread3
		ActorInstanceMapping supervisor -> logical_thread4
	}

	ActorClass Tester {
		Interface {
			conjugated Port outport: CommunicationProtocol
			Port inport: CommunicationProtocol
		}
		Structure {
			external Port outport
			external Port inport
		}
		Behavior {
			StateMachine {
				Transition init: initial -> Started { }
				Transition tr0: Started -> Done {
					triggers {
						<sendData: inport>
					}
				}
				State Started {
					entry {
						"outport.sendData();"
					}
				}
				State Done {
					entry {
						"etLogger_logInfo(\"+++   Test Done   +++\");"
					}
				}
			}
		}
	}

	ActorClass Fork {
		Interface {
			conjugated Port broadcast [*]: CommunicationProtocol
			Port inport: CommunicationProtocol
		}
		Structure {
			external Port broadcast
			external Port inport
		}
		Behavior {
			StateMachine {
				Transition init: initial -> Fork { }
				Transition tr0: Fork -> Fork {
					triggers {
						<sendData: inport>
					}
					action {
						"broadcast.sendData();"
					}
				}
				State Fork
			}
		}
	}

	ActorClass Redirect {
		Interface {
			Port inport: CommunicationProtocol
			conjugated Port outport: CommunicationProtocol
		}
		Structure {
			external Port inport
			external Port outport
		}
		Behavior {
			StateMachine {
				Transition init: initial -> Redirect { }
				Transition tr0: Redirect -> Redirect {
					triggers {
						<sendData: inport>
					}
					action {
						"outport.sendData();"
						"etLogger_logInfo(\"+++   Redirect: sendData  +++\");"
					}
				}
				State Redirect
			}
		}
	}

	ActorClass Join {
		Interface {
			Port inport [*]: CommunicationProtocol
			conjugated Port outport: CommunicationProtocol
			conjugated Port security: SecurityProtocol
		}
		Structure {
			external Port inport
			external Port outport
			external Port security
			Attribute counter: int32
			
		}
		Behavior {
			StateMachine {
				Transition init: initial -> Count {
					action {
						"counter=0;"
					}
				}
				Transition tr0: Count -> cp cp0 {
					triggers {
						<pong: security>
					}
					action {
						"counter++;"
						"etLogger_logInfo(\"+++   Join: received pong  +++\");"
					}
				}
				Transition tr1: cp cp0 -> Done {
					action {
						"outport.sendData();"
					}
				}
				Transition tr2: cp cp0 -> Count {
					cond {
						"counter<10"
					}
				}
				Transition tr3: Count -> Count {
					triggers {
						<sendData: inport>
					}
					action {
						"security.ping();"
						"etLogger_logInfo(\"+++   Join: sent ping  +++\");"
					}
				}
				ChoicePoint cp0
				State Count
				State Done
			}
		}
	}

	ActorClass Supervisor {
		Interface {
			Port application: SecurityProtocol
		}
		Structure {
			external Port application
		}
		Behavior {
			StateMachine {
				Transition init: initial -> PingPongActive { }
				Transition tr0: PingPongActive -> PingPongActive {
					triggers {
						<ping: application>
					}
					action {
						"application.pong();"
					}
				}
				State PingPongActive
			}
		}
	}

	ProtocolClass CommunicationProtocol {
		incoming {
			Message sendData()
		}
	}

	ProtocolClass SecurityProtocol {
		incoming {
			Message ping()
		}
		outgoing {
			Message pong()
		}
	}
	
	DataClass DataClass1 {
		Attribute Attr1: int32
		Attribute ComplexAttr: DataClass2
		Attribute Attr3: float32
	}

	DataClass DataClass2 {
		Attribute Attr1: int32
		Attribute Attr2: float32
		Attribute Attr3: int32
	}

}

Back to the top