Individual project - a brief analysis of metro project
demand analysis
- Storage format circuit design
- Program can parse files subway
- By subway line query the site of the line
- Discover the shortest path between two sites
- Parse command line command
test
Realization of ideas
- Each station and subway lines, a plurality of circuit sites, a site may have a plurality of lines, a picture can be kept down.
- Save the file format Subway: Line station +
- Start command line:
java subway -map subway.txt
- According subway station line inquiries:
java subway -a 1号线 -map subway.txt -o station.txt
- Discover the best path based on two sites:
java subway -b 洪湖里 复兴路 -map subway.txt -o routine.txt
Output File Format
3
Honghuli
West Station
Line 6
Fuxing Roadtest
Honghuli - Liu Yuan
Line 1
Honghuli
thrifty Road
Benxi Road
Winery
West Cross embankment
Liu YuanHonghuli - Fuxing Road
Line 1
Honghuli
West Station
Line 6
Fuxing RoadWest Railway Station - Dawangzhuang
Line 1
West Point
northwest
southwest corner
Line 2
Drum
southeast corner
Jianguo Road
Tianjin Station
Line 9
DawangzhuangError cases: no change site
can not reach the site changeto sum up:
The private job will be written in Java but mastery of Java is not enough to learn a lot of knowledge, the main difficulty is to consider the transfer between the two sites.