Elevator scheduling simulation system

xiaoxiao2021-03-06  33

Elevator scheduling simulation system

Elevator Attemper Simulation System (EASS)

Design Developer: Xushua

1. Scheduling description:

The elevator scheduling algorithm is as follows:

1. The initial state is on the first floor. There is no request in the inside and outside, then the original state is maintained.

2. The external request is sent, placed in the request list. Timed assignment:

A>. Read the current elevator status (motion status, floor)

B>. In the same direction, the shortest path is the shortest. (Removing the same direction needs to be folded)

C>. The same direction does not match, then stop the shortest path in the elevator. Modify the elevator target list.

D>. There is no requirements at this time. Then go to the next loop.

3. Internal request. The next request needs to be folded back on the elevator path. Otherwise it will not respond.

4. Opening the door, I can't stop the elevator. Elevator moves to close the door.

2. Development environment:

1. Eclipse 3.0 m8 (playing the VE plugin) (Sun JDK1.4.0_4).

2. Windows XP Professional SP1.

3. Design:

Based on the above algorithm scheduling, it is basically realizing the elevator operation in real realization. There are various elevators to operate. External, internal passengers requests and their reasonable allocation.

Using the multi-thread mechanism in the Java language, the parallelism of the actual elevator operation and processing request is simulated.

In fact, the system has a lot of thread operations. For the programs I have implemented, there is a thread. These threads work together to complete the needs of the entire system. Using Java-oriented high-oriented high-oriented plus (relative to VC , of course, VC SDK DirectX9.0B can have a more beautiful effect or MFC6.0). Therefore, it is used.

Considering the teacher's request, the alarm is originally wanted to eliminate the external request to the elevator and reassign the demand list. There is also a consideration of making the elevator more intelligence, if used in segmentation of the day, each segment processing request is different. If there is a small number, try to stop from the elevator. When people are more, try to use all elevators. Of course, I also considering whether there is a boring person in reality, I have been working with the elevator door, and so on. However, the energy is limited, and the situation is mainly to experience the wonderful place of multi-thread, all in the algorithm is not too deep.

4. Program Design:

In fact, it is said that it is better to say that it is better to say another workout. It took a few days, and the May Day is paying attention to her.

However, I finally realized my expected, not the best, but in the process of programming, I realized a lot. Since I am a history, I like to record some records, and the teacher didn't speak this part. It is necessary to feel self.

1. The observer design mode is used for the first time. Previously for the design pattern, what is the simplest factory model, single case mode. I used it before, nothing. This time I want to achieve the main control and the passage between the sub-thread (elevator thread). Of course, the main thread is created inside the thread, as its member variable. Most people should do this. Perhaps someone is doing, put the status quantity and some request lists in a static class (a bit like global variable). I use the pattern above, although I am a bit trouble. But experienced a turn. (See Elevatorarith, MainControl).

2. The first time uses the VE (visual editor) design interface (Swing / JFC). (See OutelevatorPane, OuteRelevatorDialog, InnegelevatorPane, InnelevatorDialog, Mainframe, ExpiRog, ElevatorPane). 3. I have designed a lot of small categories: StaticRequestList, ElevatorState, (Elevator status), Mycomp (for inheritance inheritance in comparrator), Disresponse (Assign External Task Response), CRequestList (request format)

4. ElevatorThread, elevator thread, RUN inside, implements the operation display of each elevator. Response to each internal request. In response to the external room in Elevatorarith.

5. Elevator motion effect: thread.sleep (time). Realization delay. I have a Timer in the main frame (time, event listener).

6. There are countless conversions for data types, and the judgment conditions have a wide range.

转载请注明原文地址:https://www.9cbs.com/read-62582.html

New Post(0)