Bug 280

Summary: Only the first route has label
Product: Group 9: Route Planning Reporter: CherineLee <shiyingli7-c>
Component: AlgorithmAssignee: Henry <728970038zjh>
Status: RESOLVED FIXED    
Severity: major CC: 728970038zjh
Priority: High    
Version: 1.0   
Hardware: PC   
OS: Mac OS   

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.