文件名称:PostDistance
介绍说明--下载内容均来自于网络,请自行研究使用
本作业为邮局选址问题。在该问题中,求邮局的最佳位置即求坐标的中位数。分解来看,即分别寻找X和Y坐标的中位数。
类设计如下:设计一个PostCal的类。计算X,Y坐标的中位数方法selectMedian(),其中partition()用于将大问题分解为子问题使用。最后有一个计算邮局到各居民点的路径总和int calSum()。
类中包含构造函数PostCal(),主要功能是实现文件读写,结果计算及输入输出。
类中包含取居民点个数的变量 num。-This job is a post office location problem. In this issue, find the best location for the post office that is seeking the median coordinates. Decomposition point of view, the X and Y coordinates, respectively, find the median.
Class is designed as follows: Design a PostCal category. Calculate X, Y coordinates of the median method selectMedian (), which partition () is used to a large problem into sub-problems to use. Finally there is a post office to calculate the sum of each path of settlements int calSum ().
Class contains a constructor PostCal (), the main function is to implement file read and write, calculate and input and output results.
Class contains the number of variables to take settlements num.
类设计如下:设计一个PostCal的类。计算X,Y坐标的中位数方法selectMedian(),其中partition()用于将大问题分解为子问题使用。最后有一个计算邮局到各居民点的路径总和int calSum()。
类中包含构造函数PostCal(),主要功能是实现文件读写,结果计算及输入输出。
类中包含取居民点个数的变量 num。-This job is a post office location problem. In this issue, find the best location for the post office that is seeking the median coordinates. Decomposition point of view, the X and Y coordinates, respectively, find the median.
Class is designed as follows: Design a PostCal category. Calculate X, Y coordinates of the median method selectMedian (), which partition () is used to a large problem into sub-problems to use. Finally there is a post office to calculate the sum of each path of settlements int calSum ().
Class contains a constructor PostCal (), the main function is to implement file read and write, calculate and input and output results.
Class contains the number of variables to take settlements num.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
PostDistance\.classpath
............\.project
............\bin\input_assign01_01.txt
............\...\output_assign_01.txt
............\...\PostCal.class
............\...\PostDistance.class
............\readme.txt
............\src\input_assign01_01.txt
............\...\output_assign_01.txt
............\...\PostCal.java
............\...\PostDistance.java
............\bin
............\src
PostDistance