This repository has been archived by the owner on Jun 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreflection.txt
13 lines (7 loc) · 2.91 KB
/
reflection.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
Nico Dinata (770318)
Based on several runs of the museum simulation with the current parameters, it can be observed that as more groups arrive, the guard has less time to just "patrol" (going in and out of the museum without escorting anyone). When the simulation just starts, the only escorting the guard has to do is to bring groups into the museum, so "security guard goes out" can be observed quite consistently for the first few groups into the simulation. However, as more groups enter and occupy the museum, the guard now has to escort groups both in and out of the museum.
This poses no real issues as long as there is always some reasonable gap in between the groups currently exploring the museum, for example when groups are ~2 rooms apart and move at approximately the same pace. In this case, even when the group in the last room is waiting for the guard to finish escorting a new group into the museum, the gap means that the group that is about to depart has ample time to enter the foyer, pass through the security check, and get escorted out of the museum before the group right behind it catches up to it.
However, this observation reveals the system's reliance on "the gap", and that taking this gap away could potentially lead to a major issue. Let's start by listing out the "movement mechanics" of the system. Groups move between rooms at a rate of WALKING_TIME * 2. Meanwhile, the "production" of new groups is dictated by, in this case, some random interval up to MAX_ARRIVE_INTERVAL. Groups outside the museum waiting to enter and those waiting inside the museum waiting to depart rely on the security guard being there to escort them. The guard, however, periodically patrols in and out of the museum, potentially missing out on new groups waiting to enter or depart the museum.
If we took a simulation run where the groups are somewhat consistently being produced at a fast rate, it is possible to run into a run where there is little to no "gap" between the groups: groups are constantly just waiting for one another to vacate a room so that they could occupy it next. In this run, eventually we'll end up with the situation where every room is occupied, including the foyer, and the guard is unable to escort a new outside group in. This forms a deadlock in the system, specifically in the foyer, as groups can't leave nor enter the foyer which is the sole entrance and exit point of the museum.
A potential design solution to this is to introduce multiple guards who are responsible to escort groups in and out of the museum. This should take care of instances where guards _just_ miss groups wanting to be escorted in or out, contributing to the "traffic".
Another potential solution is to introduce a different exit point to the museum after the last room other than the foyer. This solution leads to the museum behaving more like a "bounded buffer", with the "producer" "pushing" groups through the museum and out towards the "consumer".