Exam Solution ACIMS

Document Sample
Exam Solution ACIMS Powered By Docstoc
					                                             Midterm Exam
                                         ECE 473/573 (Spring 2006)
                                             Monday, April 3
                                            Open Book/Notes
                                               75 Minutes

Name:      SOLUTIONS
ID used for homework______________________

Total Points:
Do all problems. 100 pts.

NOTE: Answer all questions. Read questions carefully and answer what is asked for. If something is unclear,
make the assumptions you need to clarify it and be sure to write down your assumptions.

   1. Design a distributed irrigation control system for a farm which has fields, each growing a single crop such
      as rice, potatoes and corn. Each field is controlled by a single computer and has a different crop and its
      water allocation will be based on the needs of that crop. Crops with wider leaves and deeper roots need
      more water. The computers are networked to each other and to a central PC in the farm house. This PC
      allows the farmer to set the water spraying intervals and amounts each day and send these as commands
      to the field computers. These divide the water delivery amounts equally among the sprayers in the field.
      Sensors in the ground measure the moisture periodically and report these measurements to the field
      computer. The computer in each field maintains an independent record of the history of sprayings in this
      field and moisture readings. These local computers also compile the moisture information and send it to
      the central PC as an average moisture reading for the field. The central PC stores this information in a
      database. It also compares these records with the farmer's desired settings and if they differ significantly
      then it warns the farmer. The farmer can modify the spraying policy based on this information.
      Alternatively, s/he can call upon an irrigation equipment service person to check the pipes or sprays in a
      field or a moisture sensor expert to check on whether the sensors have gone bad. These persons can
      access the field computer for the more detailed information it has stored.
a) Draw a use-case diagram in which the system boundary is drawn around the central PC with the actors
   considered to be the farmer and the field computers.

                                           CENTRAL PC

                           Set Water Spraying Interval


                                                 Modify Spraying Interval


                            Receive Mositure Info

                                             Store Info in database

                                                 <<extend>> Extn point:

                                 Issue Warning

                                                    Compare Settings

                                      Call Irrigation Equipment Service
b) Draw a use-case diagram in which the system boundary is drawn around a field computer with the
   appropriate actors included.

                                        FIELD COMPUTER

                               Report Measurements
                                                    Compute Average Measurements

    Central PC       Update Spraying/Moisture Reading

                                     Set Spraying Interval

                                           Divide Amounts and Send
c) Given the use-cases above, complete the table below:

                distributed          Should be a          Of the objects
                irrigation system    (class,              selected in analysis
                                     attribute, not       indicate the category
                                     included) in         from the following:
                                     analysis             {sensor = se
                                     (indicate Obj,       actuator = ac
                                     At, or None)         state info object = sio
                                                          result object = ro
                                                          planning object = po
                                                          control model object
                                                          = cmo}
                barn                      None
                spray controller          Obj                  cmo
                field                     Obj                  Sio
                Crop                      Obj                  Po
                leaf size                 At
                root depth                At
                Water                     None
                water allocation          Obj                  Ro
                farm house                Obj                  Cmo
                spraying interval         At
                spraying amount           At
                irrigation record         Obj                  Po
                moisture sensor           Obj                  Se
                sensor reading            Obj                  Sio
                Pipe                      None
                Sprayer                   Obj                  Ac
                valve                     Obj                  Ac
                field average             Obj                  Ro
                moisture record
                record of                 Obj                  Po
                comparisons of
                moisture with
                desired values
d) Draw a class diagram showing the following:

i) the relationship between a farm and its fields
ii) the relationship between fields and crops
iii) the relationship between fields and computers
iv) the relationship between a general concept of computer and the ones mentioned in the description

                                        Field     1                1     Crop


       Farm                                   1
                                   Field Computer


                                    Central Computer
             e) Limit the consideration to a farm with two fields. Draw a top level architecture in which there is a
             coordinator component hosted on the central PC and field manager components each hosted on the two field
             computers. Show all input and output ports for distributing the irrigation commands and receiving the
             moisture reports.


                               Irrigation         Irrigation
                               Cmds Out           Cmds In         Field
Moisture                                                          Computer 1
Info In                                                                            Moisture
             Coordinator                                                           Info Out

  Moisture                     Irrigation                         Field
  Info In                      Cmds Out                           Computer 1
                                                    Irrigation                     Moisture
                                                    Cmds In                        Info Out
f) Open up one of the field managers and show its components including a local coordinator and (for simplicity)
two spray controllers and two moisture sensors. Show how the relevant information objects in the above table are
associated with the components.


                                                                    Info In
                          Info In
Sensor 1
             Moisture                Local
             Info Out                                    Spray
                                                         Info Out

Sensor 2
                              Moisture                                        SC2
           Moisture           Info In              Spray
           Info Out                                Info Out         Spray
                                                                    Info In

Local Coordinator: Water Allocation, Irrigation Record, Field Average Moisture Record
Spray Controller: Spray Controller, Sprayer
Sensor: Moisture Sensor, Sensor Reading,
g) For the objects in a field manager component, draw a sequence diagram in which the following occur in the
given order: 1) a spray command is received from the outside spray 100 gallons for 10 minutes at 5 AM, 2)
corresponding commands to turn on the sprayers are issued, 3)corresponding commands to turn off the sprayers
are issued, 4) moisture sensor readers are received some time later, and 5) an average moisture value is sent out.


          : Central PC        : Coordinator             : Sensor                     :                   : Sprayer

     Spray (100 Gallons, 10 Minutes, 5:00PM)

                                                   Start Spray (100 gallons)                     Start

                                                            Stop Spray                           Stop

                                      Send Mositure Value

                         Calculate Average Mositure Value

           Send Average Mositure Value

Shared By: