CS 3SD3 Midterm Midterm Exam Questions And Solutions - All answers are correct
34 views 1 purchase
Course
CS 3SD3 Concurrent Systems
Institution
McMaster University (mcmasteru)
CS 3SD3 Midterm Test Sample Solutions
1.[5] Consider the controller for an automatic door. Often found at supermarkets entrances and exits,
automatic doors swing open when the controller senses the person is approaching. An automatic
door has a pad in front to detect the presence of the person a...
cs 3sd3 midterm test sample solutions 15 consider the controller for an automatic door often found at supermarkets entrances and exits
automatic doors swing open when the controller senses the pe
Written for
McMaster University (mcmasteru)
CS 3SD3 Concurrent Systems
CS 3SD3 Concurrent Systems
All documents for this subject (1)
Seller
Follow
ExamsConnoisseur
Reviews received
Content preview
CS 3SD3 Midterm Test Sample Solutions
1.[5] Consider the controller for an automatic door. Often found at supermarkets entrances and exits,
automatic doors swing open when the controller senses the person is approaching. An automatic
door has a pad in front to detect the presence of the person about to walk through the doorway.
Another pad is located to the rear of the doorway so that controller can hold the door open
enough for the person to pass all the way through and also so that the door does not strike
someone standing behind it as it opens. The configuration is shown in the following figure:
The controller is in either of two states: OPEN or CLOSED, representing the corresponding
condition of the door, and there are four possible actions/conditions:
FRONT - the person is standing on the pad in front of the doorway,
REAR - the person is standing on the pad to the rear of the doorway,
BOTH - the people are standing on both pads,
NEITHER - no one is standing on either pad.
Model this controller as an FSP process, DOOR_CONTROLLER.
Solution 1:
DOOR_CONTROLLER = CLOSED,
CLOSED = (neither -> CLOSED
|both -> CLOSED
|rear -> OPEN
|front -> OPEN),
OPEN = (neither -> CLOSED
|both -> CLOSED %this is to prevent striking a person
|rear -> OPEN
|front -> OPEN).
Solution 2:
DOOR_CONTROLLER = CLOSED,
CLOSED = (neither -> CLOSED
|both -> CLOSED
|rear -> CLOSED // avoid striking people standing on
the rear pad
|front -> OPEN),
OPEN = (neither -> CLOSED
|both -> OPEN
|rear -> OPEN // avoid striking people standing on
the rear pad
|front -> OPEN).
1
This study source was downloaded by 100000850872992 from CourseHero.com on 03-07-2023 03:35:36 GMT -06:00
, 2.[10] A small hotel cafeteria is used by several customers eating breakfast. The customers either drink
tea of coffee. There is one Tea Machine and one Coffee Machine. When either Tea Machine or
Coffee Machine runs out of tea or coffee, new tea or coffee is provided by cafeteria staff.
Assume capacities of both machines are the same: N drinks. Initially both machines are full.
a.[5] Provide an FSP description of the above scenario. You must provide also a brief
description of the intended behavior for each one of the processes you define.
Hint: Possible processes for the above scenario are CUSTOMER, TEA_MACHINE,
COFFEE_MACHINE and STAFF_MEMBER.
b.[5] Provide a Petri nets (any kind) description of the above scenario.
Hint. Using Place/Transition nets is advised as it seems to be the most natural.
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller ExamsConnoisseur. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $9.99. You're not tied to anything after your purchase.