Giter Site home page Giter Site logo

codeyyang's Projects

baoleme icon baoleme

软件工程大作业后端 _王杨凯

beijingsubway icon beijingsubway

# 北京地铁最短路径 ### 一、项目背景和要求 北京的地铁交通网络已经基本成型,建成的地铁线十多条,站点上百个,现需建立一个换乘指南打印系统,通过输入起点和终点站,打印出地铁换乘指南,指南内容包括起点站、换乘站、终点站。 ### 二、功能介绍 * 地铁指定线路的查看 * 换乘指南查询 ### 三、开发平台 * 开发语言 Java1.8 * 集成开发环境:IDEA ### 四、实现算法 * BFS深度优先算法 ### 五、类职责划分 ***Station 类 存放站点信息** `public class Station { private String StationName;/*记录站点名*/ private boolean Visited;/*是否被遍历过*/ private String PreStation;/*便于搜索是返回和记录*/ List<String> StationLine = new ArrayList<>();/*该站点存在的所有线路信息*/ List<Station> NearStation = new ArrayList<>();/*该站点存在的所有邻近站点信息*/ }` ***Line 类 存放线路信息** `public class Line { String LineName;/*记录当前线路名*/ ArrayList<String> Station = new ArrayList<>();/*记录该线路中所有的站点名*/ }` [*Main 类 实现程序运转的主要功能]() `public class Main { static ArrayList<Line> LineList = new ArrayList<>();//存放所有线路的列表 static ArrayList<Station> StationList = new ArrayList<>();//存放线路站点的列表 static HashMap<String, Station> stationHashMap = new HashMap<>();//存放对应站点的Hash /*对文件进行读入和存储操作*/ public static void SubwayMessage(String pathname){}; /*输出线路信息*/ public static void PrintMessage(String StartStation, String EndStation){}; }`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.