Individual project - Subway

Metro personal project

Download Project

1, PSP table:

PSP 2.1 Personal Software Process Stages Time
Planning plan
· Estimate • Estimate how much time this task requires 24 hours
Development Develop
· Analysis · Needs analysis (including learning new technologies) 4h
· Design Spec Generate design documents 2h
· Design Review · Design Review (and his colleagues reviewed the design documents)
· Coding Standard · Code specifications (development of appropriate norms for the current development)
· Design · Specific design 2h
· Coding · Specific coding 7h
· Code Review · Code Review
· Test · Test (self-test, modify the code, submit modifications) 1h
Reporting report 1h
· Test Report · testing report 1h
· Size Measurement · Computing workload
· Postmortem & Process Improvement Plan · Hindsight, and propose process improvement plan 2h
total 20h

2, module division and design

The entire project is divided into four modules:

Module name Responsibility
The main control module Requesting user input is determined to achieve a corresponding function
Data read module Notepad content read and converted into the desired configuration of FIG.
Algorithm Analysis Module And selecting the shortest path for the subway line output
Parameter module Save all kinds of table structure

And the role of the link between the module:

Detailed module code:

1, parameter module

Attributes content
sub_name Subway line name
station_name All sites under certain subway lines
map It contains a collection of all the lines and lines for all sites
sta_id Id numbers for all sites match
sub_id Id numbers for all lines match
distance The distance between nodes
belong Site-owned line record

2, the data read module

data structure:

Odd Behavior line name, reads as follows:

The even conduct site name, reads as follows:

After reading units of two rows is completed:

3, the data analysis module

Station output (basic idea: cycling map to find the name of a line of matching output content sta_name):

Shortest Path output (basic idea: floyd triple loop):

3, code testing

a. site designated output line

Normal input:

Abnormal input (absence strip line):

b. 最短路径输出

正常输入:

1)单条线路无换乘

2)存在环路

无换乘:

有换乘:

3)双交线

无换乘:

有换乘:

4)长路线,多次换乘

5)超长线路

非正常输入:


Guess you like

Origin www.cnblogs.com/shengxue/p/11666342.html