Preliminary analysis of individual items 1 (the shortest path program subway lines)

1. Requirements Analysis

According to an introduction of the project, the software has the following three requirements:

Demand 1:

The realization of a subway line and supports the display of the calculated transfer program. After that, the user can start the program from the command line. When the program starts, it reads the command line parameters corresponding to different commands. For information subway map, we agreed that it uses a parameter -map as a symbol. It is necessary to obtain a corresponding custom file metro (designated subway.txt) -map parameters by reading the program starts, to obtain information subway map.

Demand 2:

Implement basic query operations. For example, a user wishes to query specifies subway line through the site. In this way, the application needs to support a new command-line argument -a, which specifies a user want to query subway lines. Thus, at a given subway line, you need to be able to start the program from the start line of the site, all sites sequentially output through the metro line until the terminus. We use the output file -o command-line arguments.

Demand 3:

Achieve a shortest path between any two stations is calculated (after the minimum number of sites) program, and outputs the number of sites and the path (including the departure station, the destination station and transfer line). If you want to take the subway, he hopes to pass the minimum number of stations to reach the destination from the starting point, so that you can at the command line to -b parameters plus two subway stations are named as the departure and destination, such as the user wants to know Honghuli the shortest route between Fuxing Road, is how he can use the following command to let the program will result in a write routine.txt: subway.exe -b Honghuli Fuxing Road -map subway.txt -o routine.txt.

2. Implementation analysis

Demand 1:

The demand seems to be for us to take a subway map convert to a table in text format. In other words, we want the subway line information stored in the form of text files together, you should save the information should include the subway line names , names of subway stations and station transfer information so that the application can read the file, you can have all the information about the subway lines. Among these technologies involved include pictures reading, automatic analysis, information preservation and transformation, I do not know how the computer automatically converts the picture into a text file, so I default this program uses only a subway map, and this step has been made done manually. The end result should look like this:

No.

line

Domain name

Whether the transfer station

001

1

Liu Yuan

0

002

1

West Cross embankment

0

003

1

Winery

0

All input station after subway.txt, it can be introduced into the program implements various calculations.

Demand 2:

To get directions, for example, just read the route number entered by the user and compared to all the lines in the table, the output of the site name.

Demand 3:

Example of operation:

Input:

subway.exe -b Honghuli Fuxing Road -map subway.txt -o routine.txt

Output:

3 // a total of 3 stops

Honghuli

West Point                                   // transfer station at the
Line 6
Fuxing Road

From the perspective of design and planning considerations subway, take the route should take the lead through the site increases.

For the terminal, we found it in the first line. Then there are two cases: the starting station with it and it is not in the same route on the same route, or starting point; the second case, the terminal can determine the starting point in certain directions on 1, 6 or 9.

There are two directions for a single site, to the starting station may first be traversed in both directions.

3.PSP 

PSP 2.1

Personal Software Process Stages

Time/h

Planning

plan

 

  · Estimate

  ·  How much time is estimated that the task requires

 ∞

Development

Develop

 

  · Analysis

  ·  Needs analysis  ( including learning new technologies )

 1

  · Design Spec

  ·  Generate design documentation

 1

  · Design Review

  ·  Design Review  ( and his colleagues reviewed the design documents )

 1

  · Coding Standard

  ·  Code specifications  ( development of appropriate norms for the current development )

 1

  · Design

  ·  Specific design

 10

  · Coding

  ·  Specific coding

 200

  · Code Review

  ·  Code Review

 1

  · Test

  ·  Test (self-test, modify the code, submit modifications)

 1

Reporting

report

 

  · Test Report

  ·  Test Report

 2

  · Size Measurement

  ·  Computing workload

 1

  · Postmortem & Process Improvement Plan

  ·  Hindsight and propose process improvement plan

 

31701056

Yang Zheng

Guess you like

Origin www.cnblogs.com/Non-Exited/p/11564393.html