100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Otro

CS 3SD3 Midterm Midterm Exam Questions And Solutions - All answers are correct

Puntuación
-
Vendido
2
Páginas
9
Subido en
07-03-2023
Escrito en
2022/2023

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 stri

Mostrar más Leer menos
Institución
Grado









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Estudio
Grado

Información del documento

Subido en
7 de marzo de 2023
Número de páginas
9
Escrito en
2022/2023
Tipo
Otro
Personaje
Desconocido

Temas

Vista previa del contenido

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


https://www.coursehero.com/file/110207810/LastYearMidtermAndSolutionspdf/

, 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.

Solutions:
(a) Assume M customers

const N = 4
range Jobs = 0..N

TEA_MACHINE = TEA_MACHINE[N],
TEA_MACHINE[j:Jobs] = (when j==0 replece_tea -> TEA_MACHINE[N]
| when j>0 give_tea -> TEA_MACHINE[j-1])

COFFEE_MACHINE = COFFEE_MACHINE[N],
COFFEE_MACHINE[j:Jobs] =
(when j==0 replece_coffee -> COFFEE_MACHINE[N]
| when j>0 give_coffee -> COFFEE_MACHINE[j-1])

CUSTOMER = ( drink_tea -> CUSTOMER | drink_coffee -> CUSTOMER )

Const M = 3
range Customers = 0..M
||CUSTOMERS = (forall[i:CUSTOMERS] customer[i]:CUSTOMER).

STAFF_MEMBER = (replace_tea -> STAFF_MEMBER
| replace_coffee -> STAFF_MEMBER)

||CAFETERIA = (||CUSTOMERS || TEA_MACHINE || COFFEE_MACHINE
|| STAFF MEMBER)
/{ customer[Customers].drink_tea/give_tea,
customer[Customers].drink_coffee/give_coffee
customer[Customers].replace_tea/replace_tea,
customer[Customers].replace_coffee/replace_coffee}

2
This study source was downloaded by 100000850872992 from CourseHero.com on 03-07-2023 03:35:36 GMT -06:00


https://www.coursehero.com/file/110207810/LastYearMidtermAndSolutionspdf/
$10.49
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
ExamsConnoisseur Self
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
567
Miembro desde
3 año
Número de seguidores
344
Documentos
1497
Última venta
5 días hace

4.3

67 reseñas

5
40
4
11
3
12
2
1
1
3

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes