Beruflich Dokumente
Kultur Dokumente
Credit : 50 points
Problem Statement:
Suppose that you are hired by a nuclear power plan to design the control system of its reactor.
The most important attribute of a nuclear reactor is the temperature of its core. Reactor is
provided computerized controls for decrementing and incrementing the temperature. These
controls are manipulated from a remote console, which is manned by our most competent
employee. Sensors are scattered throughout the power plant. These include thermometers,
and various types of alarms and thermostats that go off when the reactor's temperature rises
above the critical level, say 1500 degrees. You have to design the control system. Your
design must be such that the state of the reactor at any time due to incrementing and
decrementing operations of its temperature must be captured properly and any sensors which
need to be activated at a particular state of the reactor must be also incorporated. You need
to have the ability to add more and new types of sensors and consoles to the system without
modifying the reactor control code.
Design of the solution:
The design of our reactor is given in the class diagram in the last page. As you have seen that
our Reactor has only two states Normal or Critical. Normal state is the state in which the
temperature of the Reactor is below the critical temperature limit. When the Reactor is in this
state it temperature can be either increased or decreased. Other state is the Critical state. In
this state, no further increment operation will be allowed to be performed, but decrement
operation can be performed. This state management can be done by the State Pattern marked
with red box.
Many sensors are attached to our reactor. They will be informed whenever any increase or
decrease in the temperature of the reactor has occurred due to increment and decrement
operation performed by the operator from its console. So, all our sensors are Subscribers.
They are registered to our Publisher i.e. Reactor. These sensors reacts based on the state of
the Reactor. For example, our Alarm and Printer will react only when the Reactor is in the
Critical state. In this state, Alarm will be sounded and Printer will start printing the
temperature value. ( While implementing, it displays in the console ).Thermometer will be
showing the current temperature in all states. This is implemented using Publisher-Subscriber
pattern marked in green box in the diagram on the last page.
Interface Requirement:
The console of the operator will look like the following Java GUI screen. Note that our
thermometer is implemented as a JLabel object in the middle. Two operations can be initiated
by the two JButtons provided. Printer is the computer console. Finally Alarm is the speaker
of your computer. ( You must search how to beep our computer speaker in Java).
Your Tasks:
I have highlighted only the brief outline of the design. Now you have to complete the
following task:
The UML class diagram given must be completed with full information of data
members and member methods of each class.
Two interaction diagrams must be provided showing the message passing among the
various objects of the class diagram, when the INC or DEC button is pressed by the
user in its control console.
Finally, Java code must be submitted and demonstrated in the lab.
Final Line :
Subscriber
Publisher
Reactor
Alarm
State
Normal
Critical
Thermometer
Printer