Bug 277 - Can only get one station from the search
Summary: Can only get one station from the search
Status: RESOLVED FIXED
Alias: None
Product: Group 9: Route Planning
Classification: Unclassified
Component: Facility Search (show other bugs)
Version: 1.0
Hardware: PC Mac OS
: Highest blocker
Assignee: CherineLee
URL:
Depends on:
Blocks:
 
Reported: 2018-12-08 07:51 HKT by CherineLee
Modified: 2018-12-08 16:23 HKT (History)
2 users (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-08 07:51:25 HKT
Step to reproduce:
1. Run the program. In the "Route Planning System" menu, input 2 to choose "Get facility info". Then in the "Get facility info" menu, input 1 to choose "Search a facility".
2. For "Please enter station name:", input Wong Chuk Hang.
3. For "Please enter facility type:", input 1 to choose WIFI.
4. System output "Do you want to search nearby stations?", input 1 to choose Yes.

Expected result:
The firstly adjacent stations of Wong Chuk Hang is Ocean Park and Lei Tung, both of which do not have WIFI service. So the algorithm should search for the secondly adjacent station of Ocean Park and Lei Tung, which are Admiralty and South Horizons respectively. Both stations have WIFI service, we are expecting the output to be
Admiralty
South Horizons

Actual result:
Admiralty

I haven't looked at the code yet, but I am sure that in the searchFacilityNearStation() function you have stopped somehow after getting the first result.
Comment 1 zixuan.huang 2018-12-08 16:23:58 HKT
Fixed.

Actually the function did not stop after getting its first result. When it is looping the adjacent stations, namely Ocean Park and Lei Tung, of the current station Wong Chuk Hang, it stopped after checking only the first adjacent station of Ocean Park and Lei Tung, which, in this case, is Admiralty and Wong Chuk Hang. And only Admiralty has "WIFI" service.

Anyway, the bug is fixed now.