Provide a simulation of an elevator using Tasks (Threads), Message Passing (Queues), and State Machines (FSMs). In this quiz, you must save your project in Wokwi and put the URL here.
Added by Todd S.
Your feedback will help us improve your experience
Akash M and 57 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Question 2) Thread: ship-island port simulation (40%) You need to design a ship-island port simulation. You are going to have at least 20 ships. Each ship runs as a thread. They all need to get to a port at an island. Island can only have one ship at a time. Question 2 project has two modes "Unsynchronized mode" and "Synchronized mode". The ships may crash under the "Unsynchronized mode" because of race conditions. It shall run safely under the "Synchronized mode". Design YOUR OWN GUI of the project. Two modes are provided ("Unsynchronized mode" and "Synchronized mode"). "Unsynchronized mode" You can build your ship class to extend Thread class or implements Runnable class. When program starts, ships move to the island. If one ship moves to the island, all other ships try to wait until the ship finishes the job (Allows race conditions happen). Ships may crash if there are more than one ship move to island at a time. Your program detects and prints message on the GUI when ships crash. Island icon changes when a ship arrives. "Synchronized mode" You can synchronize your block of code or method. Only one ship moves at a time. (NO race conditions) All ships must finish the jobs safely. Answer the following question as comments in your Ship class (put question and your answer on the first line of your code). Question: "Which object have you chosen for the synchronize? Why?"
Akash M.
Write a program for a deterministic push-down automaton simulator. In this case, though, your simulator should include a stack that follows the rules of a push-down automaton. Keep in mind that you will need to change your input file so that the transitions are of the kind. I want this to be as general as possible, with the machine defined in an external text file. The output of this can be the same as the DFSM simulator. Simply indicate whether the machine accepts or rejects each input string. In Java.
Demonstrate that each of the following situations can be represented as a basic queuing process by identifying its components. How would you define the corresponding queuing system? a. The checkout stations in a supermarket b. The tollbooth at a road-toll checkpoint c. An auto shop or garage d. An emergency rescue unit e. A plumber f. A bus station g. The materials-handling equipment at a production facility
Sri K.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD