CSC2023 Truck Loading Problem Q&A

Verified

Added on  2019/09/16

|4
|1655
|324
Homework Assignment
AI Summary
This document provides a detailed question and answer session regarding the CSC2023 Truck Loading Problem assignment. It covers various aspects of the assignment, including the use of pseudo code, algorithm implementation, data structure choices, performance evaluation, and specific constraints related to the truck and box loading process. The Q&A clarifies the expectations for the assignment, addressing concerns about algorithm complexity, data generation, and the use of Java features. It also provides guidance on how to approach the problem, emphasizing the importance of clear and simple code over complex object-oriented designs. The document also clarifies the rules for box placement, truck dimensions, and the nature of the algorithms to be implemented.
Document Page
CSC2023: Truck Loading Problem (Semester 1, 2016/17)
----------------------------------------------------
Questions and Answers
----------------------------------------------------
GENERAL COMMENT:
If Assignment 2 specification is incomplete or vague w.r.t. some
specific issue(s), feel free to introduce your own assumptions,
take reasonable decisions etc, and then explain these in your
report providing appropriate justification. Alternatively,
contact the module leader.
Carry out the usual correctness tests checking whether your algorithms work as
desired.
Use small number of boxes and comment on the results in your submission.
------------------------------
Q: Pseudo code is difficult to write and read, as when it was
introduced to us it seemed as though there are different standards
depending on who taught it to you.
A: The reason for having pseudo code is to make the understanding
of algorithms easier, by avoiding Java-specific syntax, and abstracting
away tasks which are easier to express in few words than through
an actual program code. For example, people would normally find
it easier to understand what's going on if at some point of the
presentation of the algorithm you write:
...
sort_using_Quicksort (A)
...
rather than having to read 10++ lines of Java code implementing Quicksort.
Another common simplification is to use variables without declaring
them explicitly if it's clear from the context what they are,
and to avoid writing the curly brackets { ... } and use indentation
of the written text instead.
Of course, pseudo code is not a formal notation, and so different authors
would use
different variations. Part of your study for the CS degree is to learn
how to understand (and use) different styles of pseudo code. For example, this
can be highly important in real-life situations when you have a team of
seasoned programmers who are experts in different programming languages.
Rather
then having to learn each other's favourite programming language
(with all the intricacies and peculiarities of their syntaxes),
they could instead communicate using informal pseudo code notations which
everybody can understand.
------------------------------
Q: Do you have any examples of pseudo code that is written in
the style you prefer which I could use as a reference when
I write it for the project?
A: My lecture notes follow the style used in one of the recommended
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
textbooks. But I wouldn't claim that's the best
pseudo code style invented by people, and insist that you must use this
style. Have a look at other styles available on the Web, like this one:
http://users.csc.calpoly.edu/~jdalbey/SWE/pdl_std.html
Presumably you'll soon find that the different styles of pseudo code
are rather similar.
------------------------------
Q: Should the boxes be generated before or during the run?
A: It's better to generate all the input data needed before running the
algorithms. In this way one can use the same inputs for both algorithms, and
the time
taken to generate boxes isn't included.
------------------------------
Q: Should one include the time taken to generate test data in the comparisons?
A: No.
------------------------------
Q: Are we allowed to use sophisticated Java features in our code?
A: Your code should be executable using the common University
BlueJ environment. The extra neatness of the code is of a secondary
importance in this project. Bear in mind that the markers would normally
use BlueJ to reproduce your test results.
Also, my advice would be to use as simple as possible data structures and aim
at a clear short code. This project is not about developing a sophisticated
object oriented designs.
------------------------------
Q: Is it better to use real or integer numbers for the sizes of
boxes and trucks?
A: It's better to use integers as they allow for exact arithmetic
(operations involving real numbers are only approximate !!!). For example,
you may assume that the width of each truck is 2000 and the height is 1000.
------------------------------
Q: Can we turn boxes?
A: No
------------------------------
Q: Are all trucks the same W & H?
A: Yes
------------------------------
Q: Can there be boxes with the H & W of the truck itself?
Document Page
A: Yes
------------------------------
Q: Can there be boxes even bigger?
A: No
------------------------------
Q: Should the program provide a visual implementation of the trucks and boxes?
A: No marks will be awarded for visualisation.
------------------------------
Q: Not sure if the solution that your looking for is O(n^^2) or higher.
A: I am not looking for any specific (best) algorithm complexity (CW2 IS NOT A
COMPETITION!).
Rather, I expect a fair evaluation of the two algorithms you implemented.
------------------------------
Q: What if the algorithm "runs out" of the trucks?
A: Simply, generate at the beginning as many trucks as there are boxes.
------------------------------
Q: When you say you want a graphical summary, what do you mean exactly?
A: For example, a plot showing how the relative performance (y-axis) relates
to the number of
boxes (x-axis) for the two algorithms.
------------------------------
Q: To measure the performance are we expected to count comparisons in
the algorithm or actually measure CPU time?
A: CPU time
------------------------------
Q: Is it acceptable to test the speed in terms of comparisons
made within if statements or while loops?
A: This project is about time comparisons.
------------------------------
Q: Would we be able to sort the "boxes" before loading them onto the "trucks"
or
is this something that you're not looking to be implemented?
A: Don't sort the boxes as the aim is to implement two "on-line" algorithms
(see lecture notes)
------------------------------
Q: I fully understand that the "next fit" algorithm should not back-track
through the trucks.
Document Page
Does this limitation also apply to the piles within the trucks, or is it
acceptable
to backtrack through each pile to see if a box can be placed on a previous
pile?
A: I'd expect that the same limitation applies to the piles of boxes.
------------------------------
Q 1- I know we can just place 1 box on top of another, but can we
place more than 2 boxes on the X axis, or it is restricted to 2 boxes too?
A 1- You can add as many piles as needed as long as their total width is not
exceeding W
and the total number of boxes in a truck is not exceeding L. See the image
provided.
----------------------------------------------------
Q 2- I've read in the FAQ that we should create as many trucks as boxes, so
there is no need to dynamically create a truck when there is no space? or
both solutions are correct?
A 2- Yes both solutions are correct. The FAQ referred in the question is about
“how to prevent
running out of trucks”. So as long as you can get a truck when you need one
(instead of getting an
exception and terminating prematurely), it is fine. The new truck can either
be pre-generated and stored in
a list somewhere (as suggested in the FAQ) or generated on the fly.
chevron_up_icon
1 out of 4
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]