blob: 02ae1d22289b0147778a3ecb7141d49b406f44da [file] [log] [blame]
h3. Modeling Example "State Machine Feedback Loop"
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 T<sub>1</sub> has two different internal states 0 and 1, and task T<sub>2</sub> manages three consecutive states 0, 1, and 2. The state task T<sub>1</sub> is currently in is sent via a message to task T<sub>2</sub> before runnable R<sub>1</sub> is called. If the content of the message sent from task T<sub>1</sub> is 1, task T<sub>2</sub> increases its internal state, e.g. from state 0 to 1, and if it is 0, task T<sub>2</sub> decreases its internal state accordingly. Then, depending on the state task T<sub>2</sub> is currently in, the according runnable (R<sub>2,0</sub> for state 0, etc.) is executed. If the maximum or minimum state of task T<sub>2</sub> is reached but the received message from task T<sub>1</sub> tells task T<sub>2</sub> to further increase or respectively decrease its internal state, task T<sub>2</sub> sends a message to task T<sub>1</sub>. This message then causes task T<sub>1</sub> 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 T<sub>3</sub> and T<sub>4</sub> represent a client-server without reply and are equal to the tasks T<sub>1</sub> and T<sub>2</sub> respectively as described above in the modeling example "Client-Server without Reply". T<sub>5</sub> is a periodically activated task without any communication and identical to task T<sub>7</sub> in the modeling example "Purely Periodic without Communication".
!../pictures/example_modeling/modeling_example_state_machine_feedback_loop.png!
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.
table(classic){text-align:center; background:#f8f8f8}.
{background:#eee}.|_. Task |_. Priority |_. Preemption |_. Multiple Task Activation Limit |_. Activation |\2_. Execution Time |
|/3. T<sub>1</sub> |/3. 2 |/3. FULL |/3. 1 | Periodic |/3. R<sub>1</sub> | Uniform |
|<. Offset = 0 |<.Min = 9.9 * 10<sup>6</sup> |
|<. Recurrence = 300 * 10<sup>6</sup> |<. Max = 10 * 10<sup>6</sup> |
|/9. T<sub>2</sub> |/9. 1 |/9. FULL |/9. 1 |/3. |/3. R<sub>2,0</sub> | Uniform |
|<.Min = 99 |
|<. Max = 100 |
| Periodic |/3. R<sub>2,1</sub> | Uniform |
|<. Offset = 15 * 10<sup>6</sup> |<.Min = 99 * 10<sup>3</sup> |
|<. Recurrence = 250 * 10<sup>6</sup> |<. Max = 100 * 10<sup>3</sup> |
|/3. |/3. R<sub>2,2</sub> | Uniform |
|<.Min = 49.5 * 10<sup>6</sup> |
|<. Max = 50 * 10<sup>6</sup> |
|/3. T<sub>3</sub> |/3. 4 |/3. FULL |/3. 1 | Periodic |/3. R<sub>3</sub> | Uniform |
|<. Offset = 0 |<.Min = 99 * 10<sup>5</sup> |
|<. Recurrence = 100 * 10<sup>6</sup> |<. Max = 100 * 10<sup>5</sup> |
|/15. T<sub>4</sub> |/15. 3 |/15. FULL |/15. 1 |/6. |/3. R<sub>4,x</sub> | Uniform |
|<.Min = 99 |
|<.Max = 100 |
|/3. R<sub>4,1</sub> | Uniform |
|<.Min = 990 |
|<.Max = 1 * 10<sup>3</sup> |
| Periodic |/3. R<sub>4,2</sub> | Uniform |
|<. Offset = 15 * 10<sup>6</sup> |<.Min = 49.5 * 10<sup>3</sup> |
|<. Recurrence = 60 * 10<sup>6</sup> |<.Max = 50 * 10<sup>3</sup> |
|/6. |/3. R<sub>4,3</sub> | Uniform |
|<.Min = 990 * 10<sup>3</sup> |
|<.Max = 1 * 10<sup>6</sup> |
|/3. R<sub>4,4</sub> | Uniform |
|<.Min = 49.5 * 10<sup>6</sup> |
|<.Max = 50 * 10<sup>6</sup> |
|/6. T<sub>5</sub> |/6. 0 |/6. FULL |/6. 1 |/2. |/3. R<sub>5,1</sub> | Uniform |
|<.Min = 59.4 * 10<sup>6</sup> |
|Periodic |<. Max = 60 * 10<sup>6</sup> |
|<. Offset = 0 |/3. R<sub>5,2</sub> | Uniform |
|<. Recurrence = 1000 |<.Min = 19.8 * 10<sup>6</sup>|
| |<. Max = 20 * 10<sup>6</sup> |
In order to show the impact of changes to the model, the following consecutive variations are made to the model:
- **1) Initial Task Set** := For this variation, the tasks T<sub>1</sub>, and T<sub>2</sub> of the table above are active.
!../pictures/example_modeling/modeling_example_state_machine_feedback_loop_1.png!
- **2) Increase of Task Set Size I** := For this variation, the tasks T<sub>1</sub>, T<sub>2</sub>, T<sub>3</sub>, and T<sub>4</sub> are active. That way the utilization of the system is increased.
!../pictures/example_modeling/modeling_example_state_machine_feedback_loop_2.png!
- **3) Increase of Task Set Size II** := As from this variation on, all tasks are active. That way the utilization of the system is increased.
!../pictures/example_modeling/modeling_example_state_machine_feedback_loop_3.png!
- **4) Inter-process Activation** := As from this variation on, task T<sub>2</sub> gets activated by an inter-process activation from task T<sub>1</sub>, and task T<sub>4</sub> by an inter-process activation from task T<sub>3</sub> instead of being activated periodically. The inter-process activation in task T<sub>1</sub> is performed right after the message to task T<sub>2</sub> is written and consequently before the runnable R<sub>1</sub> is called, and in task T<sub>3</sub> task T<sub>4</sub> is called right before runnable R<sub>3</sub>. That way, a direct connection between these tasks is established.
!../pictures/example_modeling/modeling_example_state_machine_feedback_loop_4.png!
- **5) Event Frequency Increase** := As from this variation on, the periodicity of the tasks T<sub>1</sub>, T<sub>3</sub>, and T<sub>5</sub> are shortened. For task T<sub>1</sub>, the value for the period is set to 220 * 10<sup>6</sup>, the task T<sub>3</sub> to 50 * 10<sup>6</sup>, and for task T<sub>5</sub> to 500 * 10<sup>6</sup>. That way, the information density is increased.
!../pictures/example_modeling/modeling_example_state_machine_feedback_loop_5.png!
- **6) Execution Time Fluctuation** := As from this variation on, the execution time distribution is widened for both tasks. Therefore, the maximum of the uniform distribution is increased by 1 percent so that the uniform distribution varies now by 2 percent. That way, the utilization of the system is increased, which results in extinct activations.
!../pictures/example_modeling/modeling_example_state_machine_feedback_loop_6.png!
- **7) Activation** := As from this variation on, the maximum number of queued activation requests for both tasks is set to 2. That way, the problem with extinct activations resulting from the previous variation is solved.
!../pictures/example_modeling/modeling_example_state_machine_feedback_loop_7.png!
- **8) Accuracy in Logging of Data State I** := For this variation, the data accesses in all tasks are omitted. Instead, all runnablea representing a state are executed equally random, meaning the runnables R<sub>2,0</sub>, R<sub>2,1</sub>, and R<sub>2,2</sub> are each executed with a probability of 33 %, and the runnables R<sub>4,x</sub>, R<sub>4,1</sub>, R<sub>4,2</sub>, R<sub>4,3</sub>, and R<sub>4,4</sub> each with a probability of 20 %. That way, only a limited insight into the system's runtime behavior is available.
!../pictures/example_modeling/modeling_example_state_machine_feedback_loop_8.png!
- **9) Accuracy in Logging of Data State II** := For this variation, just task events are active. That way, only a limited insight into the system's runtime behavior is available.
!../pictures/example_modeling/modeling_example_state_machine_feedback_loop_9.png!