A. Requirements Analysis
According to the meaning of problems, you need to do the following:
1. The command line parameters can be determined and appropriate action
2. You can read the map information
3. The user can read a subway line from the starting station to the terminal all available
4. User writing starting station and terminals, the correct route planning and inform the user route
5. Be able to be judged incorrectly and prompt the user input
II. Design ideas
1. Taking into account the properties of each site will have a lot, it takes the form of java programming class
2. To find the shortest path problem, is used dijkstra algorithm
3. Each line to facilitate the operation id
III. The expected realization (possible follow-up will be modified)
1. Map import format: a map of import (subway.txt) with a text file
DETAILED import format is as follows:
Line 1 star anise apple orchard Old Town amusement park ......
Line 2 Jishuitan GuLouDaJie Andingmen ......
……
2. User input format
① Import Map
java subway -map subway.txt
② line designated users to view all sites
java subway -a 1号线 -map subway.txt -o station.txt
③ users to view two sites closest approach
subway.exe -b apple orchard ancient city -map subway.txt -o routine.txt
3. System Output Format
① output line designated sites
One line:
The ancient apple orchard octagonal amusement park ......
② output shortest route
From South Lishi Fuchengmen route to
One line:
South Lishi Fuxingmennei
Second line:
Fuxingmennei Fuchengmen