Ans: I had forgotten to get Support to change the details of the filenames (different for 2015). This is now sorted out and the submit command listed in the course work will work.
Ans: The short answer is that for connectingPair the second flight is permitted to be any number of days later than the initial flight, but that for bestTransferOption the two flights must both leave on the specified date (with the 90min gap between the first one arriving and the second leaving).
The long answer is:
conn = bestTransferOption("SNN", "GLA", b);
printf("Test6 of bestTransferOptions returns %d, %d; should be -1,
-1.\n",conn.first, conn.second);
Best thing is for you to save the updated main and replace the original main of your travel.c file with this new one.
Notice that in flightList.txt there is only one flight into Glasgow from any airport; that's from LHR on 17th ... and there are flights from SNN to LHR, but only on the 16th. So bestTransferOption might return this pair of flights if we allowed a later date for the second flight (but we don't)....
About marking ....
I have had a number of questions from students who have code that compiles, but does not do what they expect/want. In other words, they are having problems debugging their logical errors.
I find a very good way of tracking down logical errors is to temporarily add little printfs into your code (these extra printfs should of course be removed before submission).
Basically that's a way you can *narrow-down* where your error might be.
Ans: Yes, you are right! What I should have said is that "Greedy" depends only on the overall set of points, and the point which is first in the array when GreedyHueristic is called.
Have updated the coursework specification, to reflect what should be written about the testing of GreedyHeuristic.
Informatics Forum, 10 Crichton Street, Edinburgh, EH8 9AB, Scotland, UK
Tel: +44 131 651 5661, Fax: +44 131 651 1426, E-mail: school-office@inf.ed.ac.uk Please contact our webadmin with any comments or corrections. Logging and Cookies Unless explicitly stated otherwise, all material is copyright © The University of Edinburgh |