资源简介

物流配送路线规划系统,采用网页的形式操作,后台采用不同算法求解。

资源截图

代码片段和文件信息


package com.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.util.*;


public class Plan extends HttpServlet 
{  
    private int n;
    private int[] x;
    private int[] bestx;
    private float bestc;
    private float cc;
    private float [][]a; 
    private ArrayList bestList;
    private float speed;
    private final int SIZE=20;
    private final float MAX_SPEED=30;
    private ArrayList time;
    int [][][] p = new int[SIZE][SIZE][SIZE];
    float[][] D = new float[SIZE][SIZE];
    private Connection con;
    private Statement stmt=null;
    private ResultSet rs;
    
    
    protected void processRequest(HttpServletRequest request HttpServletResponse response)
            throws ServletException IOException 
    {
        response.setContentType(“text/html;charset=GB2312“);
        request.setCharacterEncoding(“GB2312“);
        PrintWriter out = response.getWriter();
        
       bestList = new ArrayList();
       time = new ArrayList();
       Random ram  = new Random();
       speed = ram.nextFloat()*50+10;
       
       String JDriver=“com.microsoft.sqlserver.jdbc.SQLServerDriver“;
       String connectDB=“jdbc:sqlserver://127.0.0.1:1433;DatabaseName=LogisticsService“;
       try
       {
        Class.forName(JDriver);
       }
       catch(ClassNotFoundException e)
       {
          out.println(e);
       } 
       
       try
       {  
        String user=“sa“;
        String password=“123“;
        con=DriverManager.getConnection(connectDBuserpassword);
        stmt=con.createStatement();
        }
        catch(SQLException e)
       {
          out.println(e);
      
       }
         
       
        int[] che =new int[SIZE];
        for(int i=0;i        {
            che[i]=SIZE;
        }
        String strategystorech;
        
        store=request.getParameter(“store“);
        strategy=request.getParameter(“strategy“);
        int count=2;
        for(int i=0;i        {
            ch=(String)request.getParameter(“ch“+i);
            if(ch!=null&&(!ch.equals(store)))
            {
                
                che[count]=Integer.parseInt(ch);
                count++;
            }
        }
        che[1]=Integer.parseInt(store);
             n=count-1;
             x=new int[n+1];
             bestx = new int[n+1];
             bestc = Float.MAX_VALUE;
             cc=0;
             a = new float[n+1][n+1];
        
             for(int i=1;i<=n;i++)
                 x[i]=i;
      
        if(strategy.equals(“1“))//当选择路程最短时
        {     
            try
            {
                for(int i=1;i<=n;i++)
                    for(int j=1;j<=n;j++)
                   {
                        rs=stmt.executeQuery(“select shortest from Shortest Wh

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    .CA....      4374  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\BestLine.jsp

    .CA....    136804  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\bg.jpg

    .CA....      2251  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\checkRegister.jsp

    .CA....      3367  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\checkUser.jsp

    .CA....    177857  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\ind.jpg

    .CA....      2334  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\index.jsp

    .CA....        97  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\meta-INF\context.xml

    .CA....        25  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\meta-INF\MANIFEST.MF

    .CA....      5403  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\register.jsp

    .CA....      4166  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\Route.class

    .CA....      4146  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\SelectLine.jsp

    .CA....         0  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\WEB-INF\classes\.netbeans_automatic_build

    .CA....         0  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\WEB-INF\classes\.netbeans_update_resources

    .CA....      9627  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\WEB-INF\classes\com\servlet\Plan.class

    .CA....      5876  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\WEB-INF\classes\com\servlet\PlanFilter.class

    .CA....    287022  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\WEB-INF\lib\msbase.jar

    .CA....     67115  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\WEB-INF\lib\mssqlserver.jar

    .CA....     59074  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\WEB-INF\lib\msutil.jar

    .CA....    584207  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\WEB-INF\lib\sqljdbc4.jar

    .CA....       904  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\build\web\WEB-INF\web.xml

    .CA....      3513  2013-06-25 21:51  物流配送路线规划系统\LogisticsService\build.xml

    .CA....   1357234  2013-06-30 13:11  物流配送路线规划系统\LogisticsService\dist\LogisticsService.war

    .CA....      2598  2013-06-25 19:21  物流配送路线规划系统\LogisticsService\nbproject\ant-deploy.xml

    .CA....     80725  2013-06-25 21:51  物流配送路线规划系统\LogisticsService\nbproject\build-impl.xml

    .CA....       473  2013-06-25 21:51  物流配送路线规划系统\LogisticsService\nbproject\genfiles.properties

    .CA....       577  2013-06-25 19:21  物流配送路线规划系统\LogisticsService\nbproject\private\private.properties

    .CA....       230  2013-06-30 03:16  物流配送路线规划系统\LogisticsService\nbproject\private\private.xml

    .CA....      3934  2013-06-25 21:51  物流配送路线规划系统\LogisticsService\nbproject\project.properties

    .CA....      1495  2013-06-25 21:51  物流配送路线规划系统\LogisticsService\nbproject\project.xml

    .CA....        25  2013-06-25 19:21  物流配送路线规划系统\LogisticsService\src\conf\MANIFEST.MF

............此处省略51个文件信息

评论

共有 条评论