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