SUB the create ()
Dim a (132) As the String
Dim b (132) As the String
Dim c (132) As the String
Dim d (132) As the String
Dim e (132) As the String
Dim f (132) As the String
Dim g (132) As the String
Dim f1, f2 'definition address list
Dim nm As Integer
For nm=2 To 133
Sheets (" sheet1 "). Select
Range (" A "& amp; Nm). Select
A (nm)=Selection. The Value of 'array assignment, and determined the parameters form
A (nm)=Format (a (nm), "0.00")
Range (" B "& amp; Nm). Select
B (nm)=Selection. The Value
B (nm)=Format (b (nm), "0.00")
Range (" C "& amp; Nm). Select
C (nm)=Selection. The Value
C (nm)=Format (c (nm), "0.00")
Range (" D "& amp; Nm). Select
D (nm)=Selection. The Value
D (nm)=Format (d (nm), "0.00")
Range (" E "& amp; Nm). Select
E (nm)=Selection. The Value
E (nm)=Format (e (nm), "0.00")
Range (" F "& amp; Nm). Select
F (nm)=Selection. The Value
F (nm)=Format (f (nm), "0.00")
Range (" G "& amp; Nm). Select
G (nm)=Selection. The Value
G (nm)=Format (g (nm), "0.00")
Next
Range (" A248 "). Select 'selection of the proposed model addresses storage location
For the Index=2 To 133
F1="F: \ \ singal intersection simulation inp" 'read the original file
F2=Selection. The Value
The Open f2 For the Output As # 2
The Open f1 For Binary As # 1
The Do While Not EOF (1)
The Line Input # 1, vartemp
If InStr (1, vartemp, "accDecelOwn=" "1", "" vbTextCompare) & gt; 0 Then
Vartemp=Replace (vartemp, "accDecelOwn=" 1 "" "", "accDecelOwn=" & amp; "" "" & amp; P (Index) & amp; "" "")
End the If
If InStr (1, vartemp, "diffusTm=" 60 "" "," vbTextCompare) & gt; 0 Then
Vartemp=Replace (vartemp, "diffusTm=" 60 "" "", "diffusTm=" & amp; "" "" & amp; Q (Index) & amp; "" "")
End the If
If InStr (1, vartemp, "lookAheadDistMax=" "250", "" vbTextCompare) & gt; 0 Then
Vartemp=Replace (vartemp, "lookAheadDistMax=" 250 "" "", "lookAheadDistMax=" & amp; "" "" & amp; B (Index) & amp; "" "")
End the If
If InStr (1, vartemp, "maxDecelOwn=" "to 4", "" vbTextCompare) & gt; 0 Then
Vartemp=Replace (vartemp, "maxDecelOwn=" 4 "" "", "maxDecelOwn=" & amp; "" "" & amp; N (Index) & amp; "" "")
End the If
If InStr (1, vartemp, "maxDecelTrail=" "- 3", "" vbTextCompare) & gt; 0 Then
Vartemp=Replace (vartemp, "maxDecelTrail=" "- 3" ""," maxDecelTrail="& amp; "" "" & amp; N (Index) & amp; "" "")
End the If
If InStr (1, vartemp, "minHdwy=" "0.5", "" vbTextCompare) & gt; 0 Then
Vartemp=Replace (vartemp, "minHdwy=" 0.5 "" "", "minHdwy=" & amp; "" "" & amp; M (Index) & amp; "" "")
End the If
If InStr (1, vartemp, "safDistFactLnChg=" "0.6", "" vbTextCompare) & gt; 0 Then
Vartemp=Replace (vartemp, "safDistFactLnChg=" 0.6 "" "", "safDistFactLnChg=" & amp; "" "" & amp; R (Index) & amp; "" "")
End the If
Print # 2, vartemp
Loop
Close # 1
Close # 2
ActiveCell. Offset (1, 0). Select
Next
MsgBox (" over!!!!!
")End Sub
Sub simulation ()
Dim Vissim As Vissim
Dim simulation As simulation
Dim simulationfile As String
Dim randomseed As Integer
The Set of Vissim=New Vissim
Set simulation.=Vissim simulation
Sheets (" sheet1 "). Select
Range (" A1 "). Select 'simulation file storage address
While Selection & lt;> "
"Value
simulationfile=Selection.Vissim. LoadNet simulationfile
Vissim. LoadLayout "singal. Ini"
Simulation. The Speed=0
Simulation. Randomseed=120 'can automate
Simulation. RunContinuous
ActiveCell. Offset (1, 0). Select
Wend
End Sub
CodePudding user response:
To run the program, see a line error, and then look at the line called the name of the function or method to have write wrong, did or function definition,