毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 论文 >> 正文

GPS应用论文 第9页

更新时间:2009-4-19:  来源:毕业论文
gps导航论文
 Exit Sub
        End If
        For i = 0 To n
            dist(i) = g(k, i)
            If dist(i) < 10000 Then
                pre(i) = k
            Else
                pre(i) = -1
            End If
        Next
        pre(k) = -1
        dist(k) = 0
        g(k, k) = 1
        For j = 0 To n - 1
            wm = 10000
            p = -1
            For i = 0 To n
                If g(i, i) = 0 And dist(i) < wm Then
                    p = i
                    wm = dist(i)
                End If
            Next
            If p = -1 Then
                Exit For
            Else
                g(p, p) = 1
                For i = 0 To n
                    If g(i, i) = 0 Then
                        If (dist(p) + g(p, i)) < dist(i) Then
                            dist(i) = dist(p) + g(p, i)
                            pre(i) = p
                        End If
                    End If
                Next
            End If
        Next
        strSql2 = "select * from road where street_name =" & txtEnd.Text & ""
        dr = dbobj.DataReader(strSql2)
        If dr.Read Then
            txtGj.Text = "最短路径为:" & dist(dr("e1id")) & vbCrLf & "路线为:" & txtEnd.Text
            j = dr("e1id")
            For i = 0 To n + 1
                If j > k Then
                    If pre(j) = -1 Then
                        strSql = "select street_name from road where e1id =" & pre(j) & " and e2id =" & j & ""
                        dr1 = dbobj.DataReader(strSql)
                        If dr1.Read Then
                            txtGj.Text = txtGj.Text & dr1("street_name")
                        Else
                            Exit For
                        End If
                        Exit For
                    Else
                        strSql = "select street_name from road where e1id =" & pre(j) & " and e2id =" & j & ""
                        dr1 = dbobj.DataReader(strSql)
                        dr1.Read()
                        txtGj.Text = txtGj.Text & "<--" & dr1("street_name")
                    End If
                    j = pre(j)
                ElseIf j < k Then
                    j = pre(j)
                    If pre(j) = -1 Then
                       strSql = "select street_name from road where e1id =" & j & " and e2id =" & dr("e2id") & ""
                        dr1 = dbobj.DataReader(strSql)
                        If dr1.Read Then
                            txtGj.Text = txtGj.Text & dr1("street_name")
                        Else
                            txtGj.Text = txtGj.Text & "<--" & txtStreet.Text
                            Exit For
                        End If
                        Exit For
                    Else
                        strSql = "select street_name from road where e1id =" & j & " and e2id =" & pre(j) & ""
                        dr1 = dbobj.DataReader(strSql)
                        dr1.Read()
                        txtGj.Text = txtGj.Text & "<--" & dr1("street_name")

                    End If

                End If
         751com.cn    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        txtJingdu.Text = ""
        txtWeidu.Text = ""
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        txtStreet.Text = ""
        txtEnd.Text = ""
    End Sub

    Private Sub FormMap_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... 下一页  >> 

GPS应用论文 第9页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。