0% found this document useful (0 votes)
6 views

Dynamic modeling

Dynamic modeling focuses on understanding systems through their time-dependent changes and the flow of operations in response to external stimuli. It involves concepts like events, states, and state diagrams, which represent the behavior and interactions of concurrently active objects. The document also discusses nested state diagrams, conditions, operations, and concurrency, highlighting their importance in modeling complex systems.

Uploaded by

kirubaaveena
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
6 views

Dynamic modeling

Dynamic modeling focuses on understanding systems through their time-dependent changes and the flow of operations in response to external stimuli. It involves concepts like events, states, and state diagrams, which represent the behavior and interactions of concurrently active objects. The document also discusses nested state diagrams, conditions, operations, and concurrency, highlighting their importance in modeling complex systems.

Uploaded by

kirubaaveena
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 10
DYNAMIC MODELING ‘A.system can best understood by examining its static structure that is of its objects and their relationships to each other at a single moment of time. Then the system can be examined for the changes to the objects and their relationships over time. Those aspects of a system that are connected with time and changes are the dynamic models. “Control” is the aspect of the system that describes the sequence of operations that occur in response to external stimuli, without consideration of what the operations do, what they operate on, or how they are implemented, This lesson discusses the concepts dealing with flow of control, concurrently active objects teractions and sequencing of operations in a system of EVENTS AND STATES ‘An object model describes the possible pattems of objects, attributes and links that can exist in a system. The attribute value and links held by an object are called its state. Over time, the object stimulates each other, resulting in a series of changes to their states. An individual stimulus from one object to another is an event. The response to an event depends Cn the state of the object receiving it and can include a change of state or the sending of another event to the original sender or to the third object. The pattern of events, states and state transitions for a given class can be abstracted and represented as a state diagram. A state diagram is a network of states and events. The Dynamic model consists of multiple state diagrams, one diagram for each class with important dynamic behavior and shows the pattern of activity for an entire system. EVENTS: ‘An event is something that happens at a point in time, such as right clicking the mouse button. An event has no duration; it is an occurrence. One event may logically precede or follow another or the two events may be unrelated. The events that are casually unrelated are called Concurrent events; they have no effect on each other. For example, playing an audio file and executing a program are concurrent events in systems. In modeling a system, we do not try to establish an ordering between concurrent events, since they can occur in any order. Any realistic model of a distributed system must include concurrent events and activities. ‘An event is a one-way transmission of information from one object to another. Itis not a subroutine call that returns a value. In real world all objects exists concurrently. An object sending an event to other object may expect reply. The reply is a separate event under the control of second event, which may or may not send reply. Every event is a unique occurrence, but can be grouped together into Event Classes. Each event class is given a name to indicate structure and behavior, structure is hierarchical. For example, 1A123 flight departs from Chennai and IA456 departs from Delhi are instances of event class Flight Departs. Some events are simple events, but most event classes have attributes indicates the information they convey. For example, Flight Departs has flight number, airline and city as attributes. The time at which an event occurs is an implicit attribute ofall events, The term event is often used ambiguously. Sometimes it refers to an instance and sometimes to an event class. In practice, the meaning of the event is derived from the context. Some examples for event classes and attributes are shown below: STATES state is an abstraction of the attribute values and links of an object. Sets of values are grouped together into a state according to properties that affect the gross behavior of the object. For example, a state of a bank is either solvent or insolvent depending on their assets exceeding liabilities. A state specifies the response of the object to input events. The response to an event received by an object may vary quantitatively depending on the exact attribute values, but response is ualitatively same for all values within the same state and different for values in different state. The response of the object to an event may include an action or change of state by the object. For example, if a digit is dialed, phone line as in state in DIAL TONE A state corresponds to the interval between two events received by an object. Events represents point in time, where as state represents interval of time. The state of an object depends on the past sequences of event it has receives, but in most cases past events are hidden eventually by subsequent events. For example, phone line in idle state, forgets the events that happened prior to hang up event. A state is often associated with continuous activity or activity that takes time to complete. Events and states are dual to one another, that is, an event separates two states and a state separates two events. A state is also associated with the value of an abject satisfying some condition. For example, water is liquid is equivalent to saying " the temperature of water is greater than 0 OC and less than 1000C. Each enumerated value of an attribute defines a state While defining state, the attributes that do not affect the behavior of the objects can be ignored and all the combinations of attributes and links that have common response to the events can be combined into a single state This, helps to focus the entities in the application domain ignoring the irrelevant entities. Both events and states depend on the level of abstraction used. For example, an airport status board considers departure and arrival as two different events. state can be characterized in various ways. The state should include a suggestive name, a natural language description ofits purposes, an event sequence and a declarative condition for the state in terms ofits parameter For example, characterization of State: Alarm Ringing on a watch ‘Summerize the following with subheadings STATE DIAGRAMS: A state diagram is a graphical representation of finite state machines. Itelates events and states. When an event is. received, the next state depends on the current state as well as the event. A change of state caused by an eventis called a transition. A state diagram is a graph whose nodes are states and whose directed arcs are transitions labeled by event names. A state is drawn as rounded box containing an optional name and a transition is drawn as an arrow from the receiving state to the target state. All the transitions leaving a state must correspond t different events. The state diagram specifies the state sequence caused by an event sequence. If an object is in a state and an event labeling one of its transitions occurs, the object enters the state on the target end of the transition. This transition is said to fire. If more than one transition leaves the state, the first event causes the corresponding transition to fire. If no transition leaves a state, then the event is ignored. A state diagram describes the behavior of a single class of objects. All the objects of the class can share the same state diagram. Each object is independent of other objects and can proceeds in its own pace. State diagrams can be represented as one-shot life cycles or continuous loops. One shot diagrams represents objects with finite lives. The initial state is entered on creation of an object and entering the final state implies destruction of object. The initial state is represented using a solid circle and the final state using bull's eye and they can be labeled. For example, one-shot diagram for chess diagram. ‘Summerize the following with subheadings Conditions A condition is a Boolean function of object values, which is valid over an interval of time. For example, the temperature was above 1000€ from April 2005 to June 2005. state can be defined in terms of state; conversely being in a state is a condition. Conditions can be used as guards on transitions. A guarded transition fires when its event occurs, but only if guarded condition is true. A guard condition is shown as a Boolean expression in brackets following the event name. For example, Operations A state diagram is of little use if they just describe the pattem of events. A behavioral description of an object must describe what the object does in response to events. Operations are attached to states or transitions are performed in response to the events or states. ‘An ‘activity" is an operation that takes time to complete. It is associated with a state. Activities include continuous and sequential operations. The notation "do:A’ within a state box indicates that activity A starts on the entry to the state and stops on exit ‘An ‘action’ is an instantaneous operation; associated with an event. It is used to represent operations whose duration is insignificant compared to the resolution of the state diagram. The operations can be modeled as an action, if the internal structure for control purposes is not needed. Otherwise, model as an activity. Actions can also represent internal control operations such as setting attributes or generating other events. Such actions have mechanisms for structuring control implementation; no real-world counter parts. For example, a counter can be incremented every time when particular event occurs The notation for action on a transition is a slash (°/") and the name of the action following the name of the event that causes it. The general notation for state diagrams with operations is shown below: ‘Summerize the following with subheadings NESTED STATE DIAGRAM: State diagrams can be structured to permit concise descriptions of complex systems. The ways of structuring state machines is similar to the ways of structuring objects: Generalization and Aggregation. Gerieralization is equivalent to expanding nested activities. t allows an activity to be described at higher level, then expand at a lower level by adding details. Aggregation allows a state to be broken into orthogonal components with limited interaction among them and is equivalent to concurrency of states. Problems with Flat State Diagram: State diagrams often criticized because they lack expressive power and are impractical for larger problems. These problems are true of flat, unstructured state diagrams. Consider an object with n Boolean attributes that affect control Reflecting such an object with a single flat state diagram requires 2n states; whereas by portioning into n independent state machines requires only 2n states. All complex system contains a large amount of redundancy that can be used to simplify state diagrams, provided appropriate structuring mechanisms are available. Nesting State Diagram An activity in a state can be expanded as a lower-level state diagram, each state representing one step of the activity. Nested activities are one-shot diagrams with the input and output transitions. The set of nested diagram form a lattice. For example, nested ‘Summerize the following with subheadings State Generalization: Anested state diagram is actually a form of generalization. Generalization is the ‘or-relationship’. An object in a state in high-level diagram must be exactly in one state in a nested diagram. it must be in the first state or in the second state or some other states. The states in nested diagram are all refinements of the state in the high-level diagram. in general, a state in nested diagram may interact with other states. States may have substates that inherit the transitions of their superstates. Any transition or action that applies to a state applies to its subclasses, unless overridden by an equivalent transition on the substate. For example, state diagram for automatic transmission shown below. The transmission can be forward, neutral and reverse. If itis in forward, States first, second and third are substates of state forward. A superstate is drawn as a large rounded box enclosing all ofits substates. Substates in turn can enclose further substates. rounded box represents various states are nested. is called as Contours. Event Generalization: Events can be organized into generalization hierarchy with inheritance of event attributes. The event hierarchy permits different levels of abstraction to be used at different places in a model. For example, the input events for a workstation shown below: Event mouse button and keyboard character are two kinds of user input. Both events inherit attribute time from event class (the root of hierarchy) and device attribute from the event user input. Mouse button down and mouse button up inherit location from mouse button. Keyboard characters can be divided into control and graphic character. Ultimately every actual event can be viewed as a leaf on generalization tree of events. ‘Summerize the following with subheadings Concurrency: Aggregation Concurrency: A dynamic model describes a set of concurrent objects, each with its own state and state diagram. The objects in the state diagram are inherently concurrent and can change state independently. The state of a diagram is product of the states of all objects init. ‘Astate diagram for an assembly is a collection of state diagram, one for each part. Aggregation implies concurrency. The aggregate state corresponds to combined states of all the component diagrams. Aggregation is the “and-relationship". The aggregate state is one state from the first diagram and a state from second and a state for each other diagram. The component state can interact. Guarded transitions for one object can depend on the other object being in a given state. This allows interaction between the state diagrams, while preserving modularity For example, the following figure shows the state of a car as an aggregation parts: ignition, accelerator, brake and transmission. Each component state also has substate. The state of the car includes one substate for each component. Each component undergoes transitions in parallel with all the others. The car will not start unless transmission is in neutral. This is shown by guarded expression Transmission in Neutral on the transition from ignition-off to ignition-starting Concurrency within an object: tt occurs when the object can be partitioned into subsets of attributes or links, each of which has its own subdiagram. The state of the object comprises one state from each subdiagram. The subdiagrams need not be independent; the same event can cause transition in more than one subdiagram. Partitioning the composite state into subdiagrams with the dotted line shows concurrency within a single composite state of an object. The name of the overall composite state can be written in a separate region of box, separated by a solid line from the concurrent subdiagrams. Dynamic Modeling Overview: Dynamic modeling focuses on understanding a system through its time-dependent changes and the flow of operations in response to external stimuli, Unlike static models that capture objects and relationships at a fixed point in time, dynamic models focus on the behaviors, sequencing, and interactions over time, especially in systems with concurrently active objects. Events and States Events © Definition: An event is a time-specific occurrence, such as right-clicking the mouse, It has no duration and triggers changes ina system. © Types: Events can be concurrent (unrelated) or sequential (dependant on the sequence). © Classes: Events are grouped into classes (e.g, "Flight Departs") and can carry attributes like time, flight number, etc. @ Behavior: Events are one-way transmissions of information between objects. They may trigger a reply, but this is handled as a separate event. States © Definition: A state represents the values and links of an object at a particular point, and determines how the object responds to events. © Characteristics: States are defined by the attributes that affect an object's behavior. An object's state changes based on past events, but earlier events may be forgotten once new events occur. © Example: A phone line can be in different states (¢.g.,"Dial Tone’). State Diagrams Definition © Purpose: A state diagram represents a finite state machine, with nodes as states and directed arcs as transitions caused by events. © Transitions: The event triggers a state change, and these transitions are represented by arrows between states. © Event Sequence: A state diagram defines the flow of state transitions in response to a sequence of events. Types of Diagrams © Oneshot Diagrams: Represent finitefetime objects with specific start and end states © Continuous Loops: Represent objects that remain in the system indefinitely. Conditions and Operations Conditions © Definition: A Boolean condition that applies to object values over time (e.g., "temperature above 100°C" for a period). @ Use iin Transitions: Conditions act as guards for transitions, only allowing the transition to fire if the condition is, true, Operations © Activity: An operation that takes time, associated with a state. © Action: An instantaneous operation triggered by an event. Nested State Diagrams ‘Structuring State Diagrams ©@ Generalization: Higher-level states can be broken down into more detailed states using nested diagrams. @ Aggregation: States are divided into independent, concurrent components, Problems with Flat State Diagrams © Limitations: Flat diagrams can become overly complex, especially for systems with many attributes. Nested diagrams can simplify these representations. State Generalization © Hierarchy: States can inherit transitions from superstates. Substates share behaviors with their parent states unless overridden. Concurrency in Dynamic Modeling Aggregation Concurrency © Definition: Multiple concurrent objects each with their own state diagram. The aggregate state reflects the combined states of these components, where each part can change independently © Example: A car's state could depend on the states of components like ignition, accelerator, and brake, which interact concurrently Concurrency within an Object © Internal Concurrency: When an object can be divided into subsets of attributes or links, each with its own state diagram. Multiple subdiagrams within a single object can be active at once Conclusion Dynamic modeling helps to understand and represent the changing states and behaviors of a system over time. By using events, states, and state diagrams, and incorporating concurrency and nested structures, it allows for the modeling of complex systems with multiple interacting components. Il first expand on the missing points and then provide an outline for how diagrams would be represented. Since I can't, create diagrams directly in this text-based format, Ill describe how each diagram should look so you can visualize or create them using drawing tools, Dynamic Modeling Overview: Dynamic modeling examines a system's behavior over time, emphasizing how objects interact with one another and change in response to events. Unlike static models, which describe system components at a fixed point in time, dynamic models focus on time-dependent changes and the sequence of operations in systems with multiple active components. Events and States Events © Definition: Events are time-bound occurrences that trigger changes in a system. An event is instantaneous and hhas no duration. © Types of Events: © Concurrent Events: These occur independently of one another and do not affect each other. For instance, playing an audio file and executing a program are independent events. © Sequential Events: Events that depend on each other’s occurrence. © Example: A “Flight Departs" event could carry attributes lke flight number, airline, and city © Diagram for Events: © Event Class Hierarchy Diagram: A tree structure showing how different events inherit attributes from a common root class. For Instance: Event (root) | —Userinput | |—Mousectick | '— Keyboardinput ‘SystemEvent | — NetworkError ‘— FileDownloaded States © Definition: A state is a snapshot of an object's attributes and links at a particular point in time. © Characteristics: © States dictate how an object responds to events, © The state of an object may change after an event, and past states may be forgotten after the object transitions to anew state. @ Example: A bank can be either in a ‘solvent’ or “insolvent” state, depending on its assets and liabilities, © Diagram for States: © State Diagram: Each state is represented by a rounded rectangle, and transitions between states are shown with arrows. For example: [Idle State] —> [DIAL TONE] —> [Connected] State Diagrams Definition: A state diagram is a graphical representation of a finite state machine, where nodes represent states and directed edges (arrows) represent transitions triggered by events. © Transitions: A transition occurs when an event triggers a change from one state to another. The event causing the transition is typically labeled on the arrow. © States: The states are represented as rounded rectangles. ‘Types of Diagrams: © One-shot Life Cycle: Represents objects with a finite lifespan. The object enters the initial state upon creation and exits when it reaches the final state, © Continuous Loop: Used for objects that remain in the system indefinitely. © Diagram Example (One-shot Life Cycle): ((nitial State) -- (Active) -- (Final State) @ Diagram Example (Continuous Loop): (Idle) «. (Active) .. (Paused) Conditions and Operations Condition: © Definition: Conditions are Boolean expressions that evaluate the status of an object over time, often used as uards for transitions. © Guarded Transition: A transition that will only fre if a certain condition is true. This is represented in state diagrams as a condition in brackets following the event name. © Example: [Temperature > 100°C] => Transition to “Alarm Operations: © Activity: An operation that takes time to complete, associated with a state. © Action: An instantaneous operation, linked to an event. © Diagram for Operations: e Activity Notation: In state diagrams, activities can be represented within states with the notation “do: [Activity Name] @ Action Notation: Actions are shown on transitions using a slash ('/’), Nested State Diagrams Generalization: Generalization allows states and activities to be described at a higher level and then refined at lower levels with nested state diagrams. Diagram Example: A state "Forward" might have substates 'First’, Second’, and "Third’. These states would be nested within the larger "Forward! state [Forward] — [First] | [Second] | [Third] Aggregation: © Aggregation is used when a complex system can be broken into parts, each with its own state diagram. The aggregate state combines the states of all components. @ = Example: @ Acar could have states for the ignition, accelerator, brake, and transmission. The overall state of the car is the ‘combination of these individual component states. © Diagram Example: [Car State] .. (Ignition OFF) | (Ignition ON) (Accelerator Idle) | (Accelerator Pressed) Concurrency in Dynamic Modeling Aggregation Concurrency: Aggregation implies concurrency. Different components of a system can change state independently, but their combined state represents the overall system state Example: In a car, the transmission state (Neutral, Reverse) must be in sync with the ignition and brake states. Diagram for Aggregation: A state diagram with concurrent components might look like this: [Car State] | — [Ignition OFF] }— [Transmission Neutral] '— [Accelerator Idle] Concurrency Within an Object: e ‘An object can be split into subsets of attributes or links, each with its own subdiagram. The overall object state is a combination of the states of its individual components. Diagram for Concurrency: State Subdiagram: A composite state might look like: [Object State] | — [Substate 1] | — [Substate 2] ‘— [substate 3] State and Event Generalization State Generalization: States can inherit transitions from superstates. A superstate encompasses multiple substates, which can inherit behaviors unless overridden, ith substates Example: The "Automatic Transmission” state diagram might have superstates like "Forward; “First’, "Second", and “Third! Diagram for State Generalization: [Automatic Transmission] | — [Forward] | — [Neutral] '— [Reverse] Event Generalizatior © Events can be generalized, allowing different levels of abstraction to be used at different places in the model © Diagram for Event Generalization: @ Event Hierarchy: A hierarchy for events (e.g,, "Mouse Button Down’, "Mouse Button Up") can be represented as follows: Event (Root) | —Userinput \— Systeminput Conclusion Dynamic modeling is an essential technique for modeling systems that change over time, particularly when dealing with objects that act concurrently. Through the use of events, states, and state diagrams (including nested and concurrent models), dynamic models allow us to represent complex interactions and behaviors. Using conditions and operations on transitions and states helps to fully describe the system's behavior. Nested state diagrams and event generalization improve the clarity and efficiency of modeling larger and more complex systems. Note on Diagrams: You can visualize and create these diagrams using software tools like Microsoft Visio, Lucidchart, or draw.io, where you can create states, transitions, and hierarchical event structures to represent dynamic models clearly.

You might also like