|
C M S C 2 1 4 C o m p u t e r S c i e n c e I I F a l l 2 0 0 3 |
Yes - a secondary.output file has been posted and can be used to check how your program performs on the secondary.input file.
As for the output of the "ending at ??? and ???" message the order
is important and it should be printed out in the order the user
enters (similar to the "Starting at ??? and ???" message.
Yes and No.
secondary.input is correct - in particular the line with the
number 2 (before the line with 5 to quit) is correct (note that if
the user chooses option 4 they enter the starting (and ending)
intersection and
THEN a number 1 2 or 3 - in this case they entered 2).
primary.output.v2 is incorrect - it is missing a , (comma)
and a . (period) - since submit is only accepting programs that
match this file (without the comma and period) it will be left that way
and your program should match the "broken" primary.output.v2 file (and
not print a comma or period on the extra parts required by the ".v2"
version).
Yes. When reading in the input you are reading one street at a time
(and all of its intersections - in the order they are encountered).
When you read there is a Light on a street (at an intersection), that
light occurs in "both directions" ON THAT STREET ONLY.
For example when reading the intersections for University
Boulevard (UR-193) we see there is a light ON UR-193 at the
SR-201 intersection - this means there is a light on
UR-193 only in both directions (so if someone is travelling along
UR-193 from UR-908 (or from CR-903) they will encounter a light
at UR-193 SR-201. HOWEVER if a person is travelling on SR-201 there
is no light at UR-193 (in either direction on SR-201).
How can this be physically possible? SR-201 goes under UR-193 (plus
other complexities). In reality it's a little more complex than this
but this is how it will be handled in the project.
There is a small error with the picture in the "graph.doc" and
"graphWithWeights.jpg" files - in particular the fourth intersection
of the "Campus Drive" street is with SR-910 (in the map.data file) but
in the pictures it shows the intersection as being "SR-901 CR-910" but
clearly this is a typo and it should be "SR-901 SR-910" (which is the
correct "label" - the map.data file is correct - the pictures are
incorrect for this one intersection and contain a typo).
In the real world - yes. In the 214 world - no. This will not
occur in any of the test files used when grading project #5.
Yes these are both the same intersection - so if the user enters that
they want to start (or end) at intersection "IR-495 SR-1" your program
should recognize this as a valid intersection (for the map.data file
provided) and if the user enters "SR-1 IR-495" this should be recognized
as well and is the same intersection. (Thus if you use the vCode class
posted it is recommended that the list of Code's be kept in sorted
order).
Note that in "primary.output.v2" the sentence:
Also some streets will not have a name - for example had the user chosen
to start at the intersection "CR-905 CR-907" (in the primary) then the
"starting sentence" would have been:
In real life the answer is yes, and with a little extra work your project
could handle this as well, however you can assume that no more
than two streets will ever intersect at a single intersection.
Sample header files (which you can modify or replace as you want) have
been posted. Also a visual picture
of the primary map.data file has been posted in the "Extra" directory.
NOTE: the map.data file should NOT be hardcoded and must be read from
the file (which will exist in the current directory).
CLARIFICATION: when reading the map.data file you are guaranteed that the
number of intersections for each street is 2 or more (per the BNF) and
that the [dist] for each intersection is positive and never
decreasing. The [dist] represents the "mile marker" for this
intersection along the road - for example the following is the first 3
intersections (for SR-1) in the sample map.data file:
You can not use the STL Graph class and should write a graph
class (or classes) yourself - as that is the primary reason for this
project. So you should create Vertices and Edges and a Graph class
which can be used to process them. You can use other STL classes
(like vector, map, set, ...) however you must write the code for the
graph and the code that implements dijkstra's algorithm.
Project #5 was posted at noon on November 22nd and is due by
11pm on Wednesday, December 10th, 2003.
Starting at Baltimore Avenue and Powder Mill Road
should always print out the two street names in the order the user
typed them in (so had the user entered "CR-905 SR-1" the order of output
for this one line would be reversed - but the intersection would still
be the same).
Starting at Powder Mill Road and Unnamed Road
note that one of the streets will always have a name and the other
might not - in which case Unnamed Road should always be used.
...
SR-901 0.9L
UR-193 1.6
SR-902 2.2L
...
so SR-1 intersects with SR-901 at mile marker 0.9 on SR-1, then it (SR-1)
next intersects UR-193 at mile marker 1.6 - THUS there is an edge (ONE
EDGE) between "SR-1 SR-901" and "SR-1 UR-193" and it is of length 0.7
(which is 1.6 - 0.9). Again you are guaranteed the intersections will
be listed in the correct order and the [dist] will never decrease (if it
does your program is more than welcome to throw an exception).
|
See the class syllabus for policies concerning email Last Modified: Tue Dec 9 11:39:37 EST 2003 |
|
|
|
|
|