Bug 280 - Only the first route has label
Summary: Only the first route has label
Status: RESOLVED FIXED
Alias: None
Product: Group 9: Route Planning
Classification: Unclassified
Component: Algorithm (show other bugs)
Version: 1.0
Hardware: PC Mac OS
: High major
Assignee: Henry
URL:
Depends on:
Blocks:
 
Reported: 2018-12-09 11:47 HKT by CherineLee
Modified: 2018-12-09 11:59 HKT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description CherineLee 2018-12-09 11:47:40 HKT
Step to reproduce:
1. Run the program. In the "Route Planning System" menu, input 1 to choose "GetRoute". Then in the "GetRoute" menu, input 2 to choose "SearchByLeastTrans".
2. For "Please enter start station:", input Kowloon Tong.
3. For "Please enter end station:", input Airport.

Actual result:
Least Transfer Time:4
Route 1:
Kowloon Tong->(Take KTL Line to)Yau Ma Tei or Mong Kok or Prince Edward->(Take TWL Line to)Lai King->(Take TCL Line to)Hong Kong or Kowloon or Tsing Yi->(Take AEL Line to)Airport
Kowloon Tong->(Take EAL Line to)Hung Hom->(Take WRL Line to)Nam Cheong->(Take TCL Line to)Hong Kong or Kowloon or Tsing Yi->(Take AEL Line to)Airport

Expected result:
Least Transfer Time:4
Route 1:
Kowloon Tong->(Take KTL Line to)Yau Ma Tei or Mong Kok or Prince Edward->(Take TWL Line to)Lai King->(Take TCL Line to)Hong Kong or Kowloon or Tsing Yi->(Take AEL Line to)Airport
Route 2:
Kowloon Tong->(Take EAL Line to)Hung Hom->(Take WRL Line to)Nam Cheong->(Take TCL Line to)Hong Kong or Kowloon or Tsing Yi->(Take AEL Line to)Airport

I think the problem may be that you left the command printing the route label outside the loop.
Comment 1 Henry 2018-12-09 11:59:04 HKT
Fixed! You are right. I should have foreseen this situation. The println is moved inside the for loop now.