Bug 282

Summary: Want to get the first station in the data, got the second instead
Product: Group 9: Route Planning Reporter: CherineLee <shiyingli7-c>
Component: NetworkAssignee: qiyuliang2-c
Status: RESOLVED FIXED    
Severity: blocker    
Priority: Highest    
Version: 1.0   
Hardware: PC   
OS: Mac OS   

Description CherineLee 2018-12-09 13:01:32 HKT
Step to reproduce:
1. To set up, run
 	network = Network.getInstance();
	network.initializationStations();
	network.initializationLines();
2. To get the list of all stations, run:
        List<Station> allStations = network.getStations();
3. To get the name of the first station, run:
        String result = allStations.get(0).getName();

Expected value: Central
Actual value: Admiralty

I am not sure if this is the caused by the order of the station list or the list itself has some problem. Please check both to make sure.
Comment 1 qiyuliang2-c 2018-12-09 13:17:23 HKT
Fixed.

This is because the data file we use stores stations with ID starting from 1 instead of 0. The handling of the data file is a little bit messy and caused this problem.

Now we have decided to change the data file's index such that it starts with 0 to match the loop and everything.
Comment 2 qiyuliang2-c 2018-12-09 13:18:45 HKT
*** Bug 283 has been marked as a duplicate of this bug. ***