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