The task set of the modeling example “State Machine” is expanded further in this architecture pattern by combining the ideas behind the modeling example “State Machine” and “Feedback Loop”. This means that messages are exchanged in a loop and each sender/receiver is also a state machine. To achieve this, task T1 has two different internal states 0 and 1, and task T2 manages three consecutive states 0, 1, and 2. The state task T1 is currently in is sent via a message to task T2 before runnable R1 is called. If the content of the message sent from task T1 is 1, task T2 increases its internal state, e.g. from state 0 to 1, and if it is 0, task T2 decreases its internal state accordingly. Then, depending on the state task T2 is currently in, the according runnable (R2,0 for state 0, etc.) is executed. If the maximum or minimum state of task T2 is reached but the received message from task T1 tells task T2 to further increase or respectively decrease its internal state, task T2 sends a message to task T1. This message then causes task T1 to toggle its internal state which consequently results in a switch from increasing to decreasing or vice versa. In addition to this state machine feedback loop, other system architecture patterns are added to be executed concurrently in order to increase the complexity. The tasks T3 and T4 represent a client-server without reply and are equal to the tasks T1 and T2 respectively as described above in the modeling example “Client-Server without Reply”. T5 is a periodically activated task without any communication and identical to task T7 in the modeling example “Purely Periodic without Communication”.
The table below gives a detailed specification of the tasks and their parameters. The tasks are scheduled according fixed-priority, preemptive scheduling and if not indicated otherwise, all events are active in order to get a detailed insight into the system’s behavior.
Task | Priority | Preemption | Multiple Task Activation Limit | Activation | Execution Time | |
---|---|---|---|---|---|---|
T1 | 2 | FULL | 1 | Periodic | R1 | Uniform |
Offset = 0 | Min = 9.9 * 106 | |||||
Recurrence = 300 * 106 | Max = 10 * 106 | |||||
T2 | 1 | FULL | 1 | R2,0 | Uniform | |
Min = 99 | ||||||
Max = 100 | ||||||
Periodic | R2,1 | Uniform | ||||
Offset = 15 * 106 | Min = 99 * 103 | |||||
Recurrence = 250 * 106 | Max = 100 * 103 | |||||
R2,2 | Uniform | |||||
Min = 49.5 * 106 | ||||||
Max = 50 * 106 | ||||||
T3 | 4 | FULL | 1 | Periodic | R3 | Uniform |
Offset = 0 | Min = 99 * 105 | |||||
Recurrence = 100 * 106 | Max = 100 * 105 | |||||
T4 | 3 | FULL | 1 | R4,x | Uniform | |
Min = 99 | ||||||
Max = 100 | ||||||
R4,1 | Uniform | |||||
Min = 990 | ||||||
Max = 1 * 103 | ||||||
Periodic | R4,2 | Uniform | ||||
Offset = 15 * 106 | Min = 49.5 * 103 | |||||
Recurrence = 60 * 106 | Max = 50 * 103 | |||||
R4,3 | Uniform | |||||
Min = 990 * 103 | ||||||
Max = 1 * 106 | ||||||
R4,4 | Uniform | |||||
Min = 49.5 * 106 | ||||||
Max = 50 * 106 | ||||||
T5 | 0 | FULL | 1 | R5,1 | Uniform | |
Min = 59.4 * 106 | ||||||
Periodic | Max = 60 * 106 | |||||
Offset = 0 | R5,2 | Uniform | ||||
Recurrence = 1000 | Min = 19.8 * 106 | |||||
Max = 20 * 106 |
In order to show the impact of changes to the model, the following consecutive variations are made to the model: