Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the states in the UML state diagram drawn by EA

2025-03-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

The purpose of this article is to share with you what the status is in EA's UML state diagram. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

To draw a state diagram, you must first identify which states the system has. In the case of traffic lights, we choose the traffic condition of the road as the state, and the turn-off of the traffic lights in both directions is the result of these states.

Status

The state models a situation during the execution of the state machine behavior, in which case some conditions remain the same. In most cases, this condition is not explicitly defined, but implicitly defined by the name associated with the state.

UML2.5-14.2 Behavior StateMachines (2)

For the traffic signal system, the state is to model a traffic state in the traffic signal system, in which the traffic state remains unchanged, and the conditions of each state are implicitly defined by the state name.

It is said that there are the following states:

Two-way stop state (idle)

The signal in both directions is red, and traffic is prohibited in both directions.

Road 1 Traffic status (Road1Go)

Road 1 green light, vehicle traffic; Road 2 red light, no traffic

Road 1 Safety stop status (Road1StopSafely)

Road 1 yellow light, stop on the premise of safety; road 2 red light, no traffic

Road 2 Traffic status (Road2Go)

Road 1 red light, no traffic; Road 2 green light, vehicles walking

Road 2 Safety stop status (Road2StopSafely)

Road 1 red light, no traffic; Road 2 yellow light, parking on the premise of safety

The state diagram is as follows, and each state migrates in the direction established by the migration line.

Entry behavior / exit behavior

The state can have an entry behavior. If this behavior is defined, it will be executed whenever it enters the state through an external migration. In addition, a state can have an associated exit behavior, and if this behavior is defined, it will be executed whenever the state exits.

UML2.5 14.2 Behavior StateMachines (3)

In this example, the following entry and exit behaviors are designed for each state.

Two-way stop state (idle)

Entry behavior: set the bidirectional signal status to red light

Exit behavior: none

Road 1 Traffic status (Road1Go)

Entry behavior: set road 1 signal status to green, road 2 signal state to maintain red light

Exit behavior: none

Road 1 Safety stop status (Road1StopSafely)

Entry behavior: set road 1 signal status to yellow, road 2 signal state to maintain red light

Exit behavior: set road 1 signal status to red light, road 2 signal state to maintain red light

Road 2 Traffic status (Road2Go)

Entry behavior: road 1 signal status maintains red light, road 2 signal state is set to green

Exit behavior: none

Road 2 Safety stop status (Road2StopSafely)

Entry behavior: road 1 signal is maintained at red light, road 2 signal is set to yellow light

Exit behavior: road 1 signal is maintained at red light, road 2 signal status is set to red light

Thank you for reading! This is the end of this article on "what are the states in EA drawing UML state diagrams?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report