-1

Imagine the following scenario:

For Day 1 do the Activity_A for 1-2 Hr 
For Day 1 do the Activity_B for 2-3 Hr
For Day 1 do the Activity_A for 3-4 Hr
For Day 1 do the Activity_B for 4-5 Hr
..
..
..
For Day 1 do the Activity_B for 23-24 Hr

For Day 2 do the Activity_A for 1-2 HrFor Day 2 do the Activity_B for 2-5 Hr
For Day 2 do the Activity_A for 5-6 Hr
For Day 3 do the Activity_B for 6-8 Hr
..
..
..

Which Diagram suits Activity OR Sequence or Any other? Any example for such scenario ?

Christophe
  • 68,716
  • 7
  • 72
  • 138
Prince
  • 11
  • 1
  • 5

1 Answers1

0

The primary purpose of the model is related to a precise timing. Therefore, the timing diagram seems the most appropriate one. You could us it in one of the following ways:

  • Using a lifeline for activity A and a lifeline for activity B, each lifelines having two states: running and iddle. Both would appear to be complementary of each other.

  • Since the activities don't overlap, you could also consider that running activity A and B are two states of a single lifeline, which would correspond to the processor.

About the other diagrams mentioned:

  • The sequence diagram has a strict sequencing fragment but nothing is foreseen for timing constraints.
  • The activity diagram provides for timing, and you could organize a control flow to switch from one activity to the other, using the timer event on an interruptible region. However, the diagram would appear very complex and the prcise timing would not be obvious.
Christophe
  • 68,716
  • 7
  • 72
  • 138