Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Sample Input: CustomerOrder 0800 Frank 7 0 CustomerOrder 0801 George 0 9 CustomerOrder 0802 Harry 8 0 CustomerOrder 0803 Ivan 0 8 CustomerOrder 0804 John

image text in transcribed

Sample Input:

CustomerOrder 0800 Frank 7 0 CustomerOrder 0801 George 0 9 CustomerOrder 0802 Harry 8 0 CustomerOrder 0803 Ivan 0 8 CustomerOrder 0804 John 5 0 CustomerOrder 0805 Kate 3 0 CustomerOrder 0806 Lily 1 0 PrintAvailableWorkerList 0810 PrintWorkerAssignmentList 0811 PrintMaxFulfillmentTime 0812
An online retailer has a warehouse, where workers pick items from storage shelves to fulfill customer orders. The picked items can later be packed and shipped to the customers. Each order could have a different number of items and different categories of items. To save time, a worker can handle more than one order. How would you design a system to assign workers to customer orders? For this assignment, for simplicity: Assume 2 categories of items (books and electronics), 5 initially available workers in this order: Alice, Bob, Carol, David, Emily, and each order has at most 10 items. A worker can be assigned to more than one customer order ("bundling" the orders) if all items in the orders are in the same category, but the total number of items does not exceed 10. For example, if the items are all books and no more than 10 books in multiple orders, they may be bundled. The system should not read in the entire input file before processing orders. If a worker has capacity to bundle, he/she waits to potentially bundle orders, but should not wait for more than 5 minutes. Only consecutive orders can be bundled; ie. older orders before newer ones. Assume each worker needs 1 minute to find and pick each item in the same category and an additional 5 minutes of traveling time for each category. To separately manage the customer orders, available workers, and worker assignments, use singly linked lists. We will evaluate your submissions on code01.fit.edu so we strongly recommend you to test your programs on code01.fit.edu. To preserve invisible characters, we strongly recommend you to download, NOT copy and paste, input data files. Input: To simulate the customer orders, an input file contains the customer orders in the same directory as your program file called hwl.c (HW1.java) that has the main method. Your submission takes the input file name as a command-line argument. Each line is one of the following: CustomerOrder orderTime customer numberOf Books numberOf Electronics Print Available Worker List printTime Print Worker Assignment List printTime Print MaxFulfillment Time printTime For simplicity, time is in HHMM format (HH: 00-23 and MM: 00-59), the leading zero is optional. Fulfillment Time is the amount of time between when an order is made and when a worker finishes picking items for the order(s). MaxFulfillment Time is the longest Fulfillment Time among all the orders so far. Available Worker List is in availability order. Ordering of Worker Assignment List is the expected completion time of a worker. Output: The program prints events to the standard output (screen). Each event is on one line and possible events are: Customer Order orderTime customer numOf Books numOf Electronics Worker Assignment assignmentTime worker customerl customer2 ... Order Completion orderCompletion Time customer Available Worker List workerl worker2 ... Worker AssignmentList workerl.customerl worker2.customer2a,customer 26 ... MaxFullfillment Time numberOf Minutes An online retailer has a warehouse, where workers pick items from storage shelves to fulfill customer orders. The picked items can later be packed and shipped to the customers. Each order could have a different number of items and different categories of items. To save time, a worker can handle more than one order. How would you design a system to assign workers to customer orders? For this assignment, for simplicity: Assume 2 categories of items (books and electronics), 5 initially available workers in this order: Alice, Bob, Carol, David, Emily, and each order has at most 10 items. A worker can be assigned to more than one customer order ("bundling" the orders) if all items in the orders are in the same category, but the total number of items does not exceed 10. For example, if the items are all books and no more than 10 books in multiple orders, they may be bundled. The system should not read in the entire input file before processing orders. If a worker has capacity to bundle, he/she waits to potentially bundle orders, but should not wait for more than 5 minutes. Only consecutive orders can be bundled; ie. older orders before newer ones. Assume each worker needs 1 minute to find and pick each item in the same category and an additional 5 minutes of traveling time for each category. To separately manage the customer orders, available workers, and worker assignments, use singly linked lists. We will evaluate your submissions on code01.fit.edu so we strongly recommend you to test your programs on code01.fit.edu. To preserve invisible characters, we strongly recommend you to download, NOT copy and paste, input data files. Input: To simulate the customer orders, an input file contains the customer orders in the same directory as your program file called hwl.c (HW1.java) that has the main method. Your submission takes the input file name as a command-line argument. Each line is one of the following: CustomerOrder orderTime customer numberOf Books numberOf Electronics Print Available Worker List printTime Print Worker Assignment List printTime Print MaxFulfillment Time printTime For simplicity, time is in HHMM format (HH: 00-23 and MM: 00-59), the leading zero is optional. Fulfillment Time is the amount of time between when an order is made and when a worker finishes picking items for the order(s). MaxFulfillment Time is the longest Fulfillment Time among all the orders so far. Available Worker List is in availability order. Ordering of Worker Assignment List is the expected completion time of a worker. Output: The program prints events to the standard output (screen). Each event is on one line and possible events are: Customer Order orderTime customer numOf Books numOf Electronics Worker Assignment assignmentTime worker customerl customer2 ... Order Completion orderCompletion Time customer Available Worker List workerl worker2 ... Worker AssignmentList workerl.customerl worker2.customer2a,customer 26 ... MaxFullfillment Time numberOf Minutes

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions