-
Notifications
You must be signed in to change notification settings - Fork 1
/
ARC_ABM_10-1-19_M7.s
24897 lines (23114 loc) · 926 KB
/
ARC_ABM_10-1-19_M7.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;-------------------------------------------------------------
;ARC Activity Based Modeling System Run Script
;-------------------------------------------------------------
;GUI Macro Processor Parameters
;-------------------------------------------------------------
;{label1,Note,15,"ARC Activity-Based Model"}
;{label2,Note,10,"General Settings"}
;{year,editbox,"Year (Two-digit)",N,"50"}
;{modelname,editbox,"Model Name",x,"ARC ABM"}
;{iteration,editbox,"Max Assignment Iterations",N,"200"}
;{loops,editbox,"Maximum Number of Feedback Loops",N,"6"}
;{minloop,editbox,"Minimum Number of Feedback Loops",N,"2"}
;{totzones,editbox,"Total Zones (w/Externals)",N,"6031"}
;{internals,editbox,"Range of Internal Zones",T,"1-5922"}
;{lastin,editbox,"Last Internal Before Externals",N,"5922"}
;{ext1,editbox,"First External Station",T,"5923"}
;{ext2,editbox,"Last External Station",T,"6031"}
;{airpt,editbox,"Airport Zone Number",N,3388}
;{dobbins,editbox,"Dobbins Zone Number",N,2164}
;{maxext,editbox,"Maximum External County ID",N,"6074"}
;{aoc,editbox,"Auto Operating Cost - $/mile",N,"0.1729"}
; note: aoc based on AAA Year 2015 Data - http://newsroom.aaa.com/2015/04/annual-cost-operate-vehicle-falls-8698-finds-aaa-archive/
;{toc,editbox,"Truck Operating Cost - $/mile",N,"0.5360"}
; note: toc based on fuel cost of $2.96/gal & fuel efficiency of 6 mpg
; gas prices source: http://www.eia.gov/dnav/pet/pet_pri_gnd_dcus_r1z_a.htm
;{avot,editbox,"Auto Value of Time - $/hr",N,"21.50"}
;{avot_toll,editbox,"Auto Value of Time - $/hr (toll skims)",N,"30.00"}
;{tvot,editbox,"Truck Value of Time - $/hr",N,"36.00"}
;{distwgt,editbox,"Distance Weight for Generalized Cost",N,"0.5"}
;ProcID:{ProcID,editbox,"Cube Cluster Process ID (no spaces)",T,"ARC"}
;XCPU:{XCPU,editbox,"Extra CPUs Available for Cube Cluster",N,"63"}
;waitTime:{waitTime,editbox,"Cluster Node Restart Wait Time",N,20}
;archive:{archive,Checkbox,"Archive (Zip Results)",0}
;{label24,Note,10,"Modules to Run"}
;chkPrep:{chkPrep,Checkbox,"Model Preparation",1}
;chkComVeh:{chkComVeh,Checkbox,"Commercial Vehicle and Truck Model",1}
;chkFdB:{chkFdB,Checkbox,"Feedback Loops (includes CT-RAMP)",1}
;chkTrn:{chkTrn,Checkbox,"Transit Assignment",1}
;chkTOD:{chkTOD,Checkbox,"Assignment Post-Processing",1}
;chkPerf:{chkPerf,Checkbox,"Performance Measures",1}
;{label23,Note,10,"Feedback"}
;{note3,Note,8,"MODULE: Model Preparation"}
;chkATy:{chkATy,Checkbox,"Assign Area Types",1}
;chkBNw:{chkBNw,Checkbox,"Build Networks",1}
;chkBPkS:{chkBPkS,Checkbox,"Build Peak Period Skims",1}
;chkWarmStart:{chkWarmStart,Checkbox,"Warm Start Peak Period Highway Assignment",1}
;chkBFFS:{chkBFFS,Checkbox,"Build Free-Flow Skims",1}
;chkext:{chkext,Checkbox,"Update External Trips",1}
;{note12,Note,8,"MODULE: Commercial Vehicle and Truck Model"}
;chkComTG:{chkComTG,Checkbox,"Commercial Vehicle and Truck Trip Generation",1}
;chkComTD:{chkComTD,Checkbox,"Commercial Vehicle and Truck Trip Distribution",1}
;chkComTOD:{chkComTOD,Checkbox,"Commercial Vehicle and Truck TOD Trip Tables",1}
;{note4,Note,8,"MODULE: Feedback Loops"}
;chkHwS:{chkHwS,Checkbox,"Update Peak Period Travel Skims",1}
;chkTrS:{chkTrS,Checkbox,"Transit Skims",1}
;chkAccess:{chkAccess,Checkbox,"Create Accessibilities",1}
;chkIEAP:{chkIEAP,Checkbox,"Create IE and Air Passenger Demand",1}
;chkCTRAMP:{chkCTRAMP,Checkbox,"Create II Demand with CT-RAMP Model",1}
;chklod:{chklod,Checkbox,"Highway Assignments",1}
;{note5,Note,8,"MODULE: Transit Assignment"}
;chktas:{chktas,Checkbox,"Transit Assignment",1}
;{note6,Note,8,"MODULE: Post Process Assignments"}
;chktrnlod:{chktrnlod,Checkbox,"Assign Transit Drive Access - Egress to Network",1}
;chkMrg:{chkMrg,Checkbox,"Merge and Summarize Highway Networks",1}
;chkTrnMrg:{chkTrnMrg,Checkbox,"Merge and Summarize Transit Networks",1}
;{note7,Note,8,"MODULE: Performance Measures"}
;chkModSum:{chkModSum,Checkbox,"Run Main Model Summary",1}
;chkMeasures:{chkMeasures,Checkbox,"Run Performance Measures",0}
;{label3,Note,10,"CT-RAMP General Inputs"}
;propFile:{propFile,editbox,"Java Properties File (without extension)",N,"arcTourBased"}
;projDir:{projDir,editbox,"Project Directory",N,"C:/ARCABM/TRP50v0"}
;jdk64:{jdk64,editbox,"Directory to 64bit JDK",N,"C:/Progra~1/Java/jdk1.8.0_171"}
;VoyPath:{VoyPath,editbox,"Directory to 64-bit Cube Voyager File API",N,"C:/Progra~1/Citilabs/VoyagerFileAPI"}
;javaMem:{javaMem,editbox,"Java Virtual Memory for ArcTourBasedModel Process Node Launcher",N,"3g"}
;randomSeed:{randomSeed,editbox,"Model - Random Seed",N,0}
;HHIDTrace:{HHIDTrace,editbox,"Debug - Trace Household ID List",N,""}
;{label6,Note,10,"CT-RAMP Result Files and Database"}
;writeToFile:{writeToFile,checkbox,"Results - Write Data to Files",1,False,True}
;writeToDB:{writeToDB,checkbox,"Results - Write Data to Database",0,False,True}
;{label9,Note,10,"CT-RAMP Run Model IP and Port Settings"}
;hhSerAdd:{hhSerAdd,editbox,"RunModel - Household Server Address",N,"localhost"}
;hhSerPort:{hhSerPort,editbox,"RunModel - Household Server Port",N,1139}
;{label10,Note,10,"CT-RAMP Models to Run with Restart 1st Iteration"}
;restart:{restart,RadioBtn,"Restart Option","None","Usual Work/School Location Choice","Auto Ownership","Individual Mandatory Tour Frequency","Joint Tour Frequency","Individual Non-Mandatory Tour Frequency","Stop Frequency"}
;{label11,Note,10,"CT-RAMP Models to Run with Restart Subsequent Iterations"}
;restart2p:{restart2p,RadioBtn,"Restart Option","None","Usual Work/School Location Choice","Auto Ownership","Individual Mandatory Tour Frequency","Joint Tour Frequency","Individual Non-Mandatory Tour Frequency","Stop Frequency"}
;{label12,Note,10,"CT-RAMP Models to Run"}
;runUWSLC:{runUWSLC,checkbox,"Run Model - Usual Work And School Location Choice",1,False,True}
;runAO:{runAO,checkbox,Run Model - Auto Ownership,1,False,True}
;runFP:{runFP,checkbox,Run Model - Free Parking,1,False,True}
;runCDAP:{runCDAP,checkbox,Run Model - Coordinated Daily Activity Pattern,1,False,True}
;runIMTF:{runIMTF,checkbox,Run Model - Individual Mandatory Tour Frequency,1,False,True}
;runMTMC:{runMTMC,checkbox,Run Model - Mandatory Tour Mode Choice,1,False,True}
;runMTDTAP:{runMTDTAP,checkbox,Run Model - Mandatory Tour Departure Time And Duration,1,False,True}
;runJTF:{runJTF,checkbox,Run Model - Joint Tour Frequency,1,False,True}
;runJTLC:{runJTLC,checkbox,Run Model - Joint Tour Location Choice,1,False,True}
;runTMC:{runTMC,checkbox,Run Model - Joint Tour Mode Choice,1,False,True}
;runTDTAD:{runTDTAD,checkbox,Run Model - Joint Tour Departure Time And Duration,1,False,True}
;runINMTF:{runINMTF,checkbox,Run Model - Individual Non Mandatory Tour Frequency,1,False,True}
;runINMTLC:{runINMTLC,checkbox,Run Model - Individual Non Mandatory Tour Location Choice,1,False,True}
;runNMTMC:{runNMTMC,checkbox,Run Model - Individual Non Mandatory Tour Mode Choice,1,False,True}
;runINMTDTAD:{runINMTDTAD,checkbox,Run Model - Individual Non Mandatory Tour Departure Time And Duration,1,False,True}
;runAWSF:{runAWSF,checkbox,Run Model - At Work Subtour Frequency,1,False,True}
;runAWSLC:{runAWSLC,checkbox,Run Model - At Work Subtour Location Choice,1,False,True}
;runAWSMC:{runAWSMC,checkbox,Run Model - At Work Subtour Mode Choice,1,False,True}
;runAWSDTAD:{runAWSDTAD,checkbox,Run Model - At Work Subtour Departure Time And Duration,1,False,True}
;runSF:{runSF,checkbox,Run Model - Stop Frequency,1,False,True}
;runSL:{runSL,checkbox,Run Model - Stop Location,1,False,True}
;runST:{runST,checkbox,Run Model - Stop Timing,1,False,True}
;runSMC:{runSMC,checkbox,Run Model - Stop/Trip Mode Choice,1,False,True}
;{label14,Note,10,"CT-RAMP Distributed Model Run Settings"}
;packetSize:{packetSize,editbox,"Distributed Task Packet Size",N,2000}
;initPacSize:{initPacSize,editbox,"Initialization Packet Size",N,0}
;numInitPac:{numInitPac,editbox,"Number Initialization Packets",N,0}
;{label15,Note,10,"CT-RAMP Population Synthesizer Inputs"}
;popsynHHFile:{popsynHHFile,editbox,"Population Synthesizer Household File",N,"inputs/households.csv"}
;popsynPerFile:{popsynPerFile,editbox,"Population Synthesizer Person File",N,"inputs/persons.csv"}
;sampSize:{sampSize,editbox,"Population Synthesizer Sample Percents",N,"0.5,1.0,1.0"}
;sampleSeed:{sampleSeed,editbox,"Population Synthesizer Sample Seed",N,0}
;hhDAO:{hhDAO,editbox,"Disk-Based HH Manager - Filenames",N,"C:/temp/hhDiskArrayFiles"}
;numInMemHH:{numInMemHH,editbox,"Disk-Based HH Manager - Number HH in Memory",N,10000}
;{label16,Note,10,"CT-RAMP Usual Work And School Location Choice Model Settings"}
;uwslcRunWork:{uwslcRunWork,checkbox,"Usual Work And School Location Choice - Run Work",1,False,True}
;uwslcRunUniv:{uwslcRunUniv,checkbox,"Usual Work And School Location Choice - Run University",1,False,True}
;uwslcRunSch:{uwslcRunSch,checkbox,"Usual Work And School Location Choice - Run School",1,False,True}
;uwslcSPMaxI:{uwslcSPMaxI,editbox,"Usual Work And School Location Choice - Shadow Pricing - Max Iterations - 1st Feedback Loop",N,1}
;uwslcSPMaxI2p:{uwslcSPMaxI2p,editbox,"Usual Work And School Location Choice - Shadow Pricing - Max Iterations - Subsequent Feedback Loops",N,1}
;restartWSP:{restartWSP,checkbox,"Use Initial Shadow Pricing File for 1st Feedback Loop",1,False,True}
;alwaysfirstWSP:{alwaysfirstWSP,checkbox,"Always Use the Initial Shadow Pricing File for Feedback Loops",1,False,True}
;uwslcSPInF:{uwslcSPInF,editbox,"Initial Usual Work And School Location Choice Shadow Pricing Input File",N,"ShadowPricing_1_0.csv"}
;{label18,Note,10,"CT-RAMP Sample of Alternatives Sample Size Settings"}
;uwslcSOASS:{uwslcSOASS,editbox,"Usual Work And School Location Choice Sample Of Alts - Sample Size",N,30}
;jtlcSOASS:{jtlcSOASS,editbox,"Joint Tour Location Choice Sample Of Alts - Sample Size",N,30}
;inmtlcSOASS:{inmtlcSOASS,editbox,"Individual Non Mandatory Tour Location Choice Sample Of Alts Sample Size",N,30}
;awstlcSOASS:{awstlcSOASS,editbox,"At Work Subtour Location Choice Sample Of Alts - Sample Size",N,30}
;sLocSOASS:{sLocSOASS,editbox,"Stop Location Sample Of Alts - Sample Size",N,30}
;{label20,Note,10,"CT-RAMP Model Results Files"}
;rUWSLC:{rUWSLC,editbox,"Results - Usual Work And School Location Choice",N,"wsLocResults.csv"}
;rAO:{rAO,editbox,"Results - Auto Ownership",N,"aoResults.csv"}
;rCDAP:{rCDAP,editbox,"Results - Coordinated Daily Activity Pattern",N,"cdapResults.csv"}
;{label22,Note,10,"CT-RAMP Output Files"}
;tmcSUP:{tmcSUP,checkbox,"Tour Mode Choice Save Utilities and Probabilities",1,False,True}
;printTripsData:{printTripsData,checkbox,"Output Trips Data for ABMVIZ",1,False,True}
;{label25,Note,10,"Model Summary Settings"}
;{days,editbox,"Annual Work Days",N,"250"}
;{pcvot,editbox,"Passenger Car Value of Time",N,"21.50"}
;{tkvot,editbox,"Commercial Vehicle Value of Time",N,"36.00"}
;{passg_fuel,editbox,"Average Passenger Vehicle Fuel Economy",N,"25.00"}
;{trk_fuel,editbox,"Average Commercial Vehicle Fuel Economy",N,"6.20"}
;{pcfuel_cost,editbox,"Car Fuel Cost",N,"2.855"}
;{tkfuel_cost,editbox,"Truck Fuel Cost",N,"2.02"}
;-------------------------------------------------------------
; START CLUSTER NODES
*"C:\Program Files\Citilabs\CubeVoyager\Cluster.exe" {ProcID} 1-{XCPU} START EXIT
merge=5 ;set hov merge penalty (seconds)
COMP zoneDataCSV = 'ZoneData.csv'
COMP ZoneAccess = 'accessibility.csv'
COMP hhDataFile = 'hhData.csv'
COMP perDataFile = 'personData.csv'
COMP iTourDataFile = 'indivTourData.csv'
COMP jTourDataFile = 'jointTourData.csv'
COMP iTripDataFile = 'indivTripData.csv'
COMP jTripDataFile = 'jointTripData.csv'
COMP tripsDataFile = 'tripData.csv'
COMP skimsDataFile = 'travelTimeData.csv'
COMP timeFormat = '%.1f'
COMP uwslcSPOutF = 'ShadowPricing'
COMP hhTable = 'household_data'
COMP perTable = 'person_data'
COMP iTourTable = 'indiv_tour_data'
COMP jTourTable = 'joint_tour_data'
COMP iTripTable = 'indiv_trip_data'
COMP jTripTable = 'joint_trip_data'
COMP runPopSyn = 'False'
COMP uecDC = 'ctrampModels/DestinationChoice.xls'
COMP uecSOAC = 'ctrampModels/DestinationChoiceAlternativeSample.xls'
COMP uecAO = 'ctrampModels/AutoOwnership.xls'
COMP uecFP = 'ctrampModels/FreeParkingEligibility.xls'
COMP uecCDAP = 'ctrampModels/CoordinatedDailyActivityPattern.xls'
COMP uecTMC = 'ctrampModels/ModeChoice.xls'
COMP uecIMTF = 'ctrampModels/IndividualMandatoryTourFrequency.xls'
COMP uecAWSF = 'ctrampModels/AtWorkSubtourFrequency.xls'
COMP uecJTF = 'ctrampModels/JointTours.xls'
COMP uecINMTF = 'ctrampModels/IndividualNonMandatoryTourFrequency.xls'
COMP uecTDT ='ctrampModels/TourDeparture.xls'
COMP uecTAT ='ctrampModels/TourArrival.xls'
COMP uecTD ='ctrampModels/TourDuration.xls'
COMP uecTDAA ='ctrampModels/TourDepartureAndArrival.xls'
COMP uecSF = 'ctrampModels/StopFrequency.xls'
COMP uecSL = 'ctrampModels/StopDestinationChoice.xls'
COMP uecSLS = 'ctrampModels/StopDestinationChoiceAlternativeSample.xls'
COMP uecST1 = 'ctrampModels/StopDepartureAndDurationStage1.xls'
COMP uecST2 = 'ctrampModels/StopDepartureAndDurationStage2.xls'
COMP uecTripMC = 'ctrampModels/TripModeChoice.xls'
COMP uecPLC = 'ctrampModels/Parklocation.xls'
COMP uecSkims = 'ctrampModels/TravelTime.xls'
COMP uwslcSTCInF = 'ctrampModels/DestinationChoiceSizeCoefficients.csv'
COMP uwslcALInF = 'ctrampModels/DestinationChoiceAlternatives.csv'
COMP sDCSCInF = 'ctrampModels/StopDestinationChoiceCoefficients.csv'
COMP sPurpLkupProp = 'ctrampModels/StopPurposeLookup.csv'
COMP cdbdPAF = 'ctrampModels/cbd_parking_zones.csv'
COMP tssaeALInF = 'ctrampModels/TourSkimStartAndEndAlternatives.csv'
COMP tdtALInF = 'ctrampModels/TourDepartureAlternatives.csv'
COMP tatALInF = 'ctrampModels/TourArrivalAlternatives.csv'
COMP tdALInF = 'ctrampModels/TourDurationAlternatives.csv'
COMP inmtfALInF = 'ctrampModels/IndividualNonMandatoryTourFrequencyAlternatives.csv'
COMP inmtFEProbF = 'ctrampModels/IndividualNonMandatoryTourFrequencyExtensionProbabilities.csv'
COMP st1ALInF = 'ctrampModels/StopDepartureTimeStage1Alternatives.csv'
COMP st2ALInF = 'ctrampModels/StopDepartureTimeStage2Alternatives.csv'
COMP soaSwitch = '1,1,1,1,1,1,0,0,0,0,0,0,0,0'
;Calculate some global parameters
externals='{ext1}-{ext2}'
numZones = {lastin}
zonesSq ={lastin}*{lastin}
sampSizeArrayInit = '{sampSize}'
sampSizeArray = '{sampSize}'
sampleSeed = '{sampleSeed}'
;shadow pricing iteration counter is base 0
uwslcSPMaxI = {uwslcSPMaxI} - 1
uwslcSPMaxI2p = {uwslcSPMaxI2p} - 1
IF({restart.n}=1) RestartCode = 'none'
IF({restart.n}=2) RestartCode = 'uwsl'
IF({restart.n}=3) RestartCode = 'ao'
IF({restart.n}=4) RestartCode = 'imtf'
IF({restart.n}=5) RestartCode = 'jtf'
IF({restart.n}=6) RestartCode = 'inmtf'
IF({restart.n}=7) RestartCode = 'stf'
IF({restart2p.n}=1) RestartCode2p = 'none'
IF({restart2p.n}=2) RestartCode2p = 'uwsl'
IF({restart2p.n}=3) RestartCode2p = 'ao'
IF({restart2p.n}=4) RestartCode2p = 'imtf'
IF({restart2p.n}=5) RestartCode2p = 'jtf'
IF({restart2p.n}=6) RestartCode2p = 'inmtf'
IF({restart2p.n}=7) RestartCode2p = 'stf'
;create logFiles folder - if folder already exists, returns ? in print file
*mkdir logFiles
*mkdir EVAL
;clean out old log files - ones without a filelock from the CT-RAMP processes
*del logFiles /Q
;delete feedback convergence print file if present (because the program appends the print file)
*del fdbconverge.prn
IF({chkPrep.n}+{chkComVeh.n}+{chkFdB.n}+{chkTrn.n}+{chkTOD.n}=0) goto :End
IF({chkPrep.n}=0) goto :CheckComVeh
;copy shadow pricing file to model root directory
*copy PARAMETERS\ShadowPricing_1_0_Yr{year}.csv ShadowPricing_1_0.csv
;copy autoOwnershipDistrict file into root of model
*copy PARAMETERS\autoOwnershipDistrict.csv autoOwnershipDistrict.csv
;Read in landuse data
RUN PGM=MATRIX
RECI=INPUTS\Emp{year}.csv,delimiter=',' TAZ=1,FIPS=2,EMP=3,N11=4,N21=5,N22=6,N23=7,N313233=8,N42=9,N4445=10,N4849=11,N51=12,N52=13,N53=14,
N54=15,N55=16,N56=17,N61=18,N62=19,N71=20,N72=21,N81=22,N92=23,CONS=24,MANU=25,TCU=26,WHOL=27,RETAIL=28,
FIRE=29,SERV=30,GOVT=31
RECO=EMP.DBF,FIELDS=RECI.ALLFIELDS
IF(RECI.RECNO>1)
WRITE RECO=1
ENDIF
ENDRUN
;USE THE SAME INPUT AS POPSYN - WRITE AS DBF FOR COLUMN HEADERS
RUN PGM=MATRIX
ZDATI[1] = INPUTS\HSHLD{year}G.TXT, z=#1, i1s1=#2, i1s2=#3, i1s3=#4, i1s4=#5, i1s5=#6, i1s6=#7,
i2s1=#8, i2s2=#9, i2s3=#10, i2s4=#11, i2s5=#12, i2s6=#13,
i3s1=#14, i3s2=#15, i3s3=#16, i3s4=#17, i3s5=#18, i3s6=#19,
i4s1=#20, i4s2=#21, i4s3=#22, i4s4=#23, i4s5=#24, i4s6=#25,
hh = #26, pop=#27
RECO[1]=HH.DBF,FIELDS=TAZ,I1H1,I1H2,I1H3,I1H4,I1H5,I1H6,I2H1,I2H2,I2H3,I2H4,I2H5,I2H6,I3H1,I3H2,I3H3,I3H4,I3H5,I3H6,I4H1,I4H2,I4H3,I4H4,I4H5,I4H6,HH,POP
ZONES={lastin}
ZONEMSG=50
RO.TAZ=I
RO.I1H1=ZI.1.I1S1
RO.I1H2=ZI.1.I1S2
RO.I1H3=ZI.1.I1S3
RO.I1H4=ZI.1.I1S4
RO.I1H5=ZI.1.I1S5
RO.I1H6=ZI.1.I1S6
RO.I2H1=ZI.1.I2S1
RO.I2H2=ZI.1.I2S2
RO.I2H3=ZI.1.I2S3
RO.I2H4=ZI.1.I2S4
RO.I2H5=ZI.1.I2S5
RO.I2H6=ZI.1.I2S6
RO.I3H1=ZI.1.I3S1
RO.I3H2=ZI.1.I3S2
RO.I3H3=ZI.1.I3S3
RO.I3H4=ZI.1.I3S4
RO.I3H5=ZI.1.I3S5
RO.I3H6=ZI.1.I3S6
RO.I4H1=ZI.1.I4S1
RO.I4H2=ZI.1.I4S2
RO.I4H3=ZI.1.I4S3
RO.I4H4=ZI.1.I4S4
RO.I4H5=ZI.1.I4S5
RO.I4H6=ZI.1.I4S6
RO.HH=ZI.1.HH
RO.POP=ZI.1.POP
WRITE RECO=1
ENDRUN
RUN PGM=MATRIX
RECI=INPUTS\Univ{year}.csv,delimiter=',' TAZ=1,UNIV=2,ACRES=3
RECO=UNIVERSITY.DBF,FIELDS=RECI.ALLFIELDS
IF(RECI.RECNO>1)
WRITE RECO=1
ENDIF
ENDRUN
RUN PGM=MATRIX
RECI=INPUTS\SchoolEnroll{year}.csv,delimiter=',' TAZ=1,EnrollDS=2,EnrollPD=3
RECO=SchoolEnroll.DBF,FIELDS=RECI.ALLFIELDS
IF(RECI.RECNO>1)
WRITE RECO=1
ENDIF
ENDRUN
RUN PGM=MATRIX
ZDATI[1]=EMP.DBF,Z=TAZ
ZDATI[2]=HH.DBF,Z=TAZ
ZDATI[3]=UNIVERSITY.DBF,Z=TAZ
ZDATI[4]=SCHOOLENROLL.DBF,Z=TAZ
ZDATI[5] = inputs\ExtraZoneData{year}.prn,
z = #1, ;zone
distr = #2, ;district code
parkt = #3, ;total parking spaces
parkl = #4, ;long term parking spaces
propf = #5, ;proportion free parking
parkr = #6, ;parking rate (charge)
cnty = #7, ;county code
cbd = #8 ;cbd flag
RECO=ZoneData.DBF,FIELDS=zone(8.0),construc(10.0),manufac(10.0),TCU(10.0),wholesl(10.0),retail(10.0),FIRE(10.0),service(10.0),private(10.0),
govt(10.0),govt2(10.0),emp(10.0),pop(10.0),hshld(10.0),univ(10.0),acres(10.0),otherEmp(10.0),district(10.0),
PARKTOT(10.0),PARKLNG(10.0),PROPFREE(10.3),PARKRATE(10.3),county(8.0),cbdflag(8.0),
N11(10.0),N21(10.0),N22(10.0),N23(10.0),N313233(10.0),N42(10.0),N4445(10.0),N4849(10.0),N51(10.0),N52(10.0),N53(10.0),
N54(10.0),N55(10.0),N56(10.0),N61(10.0),N62(10.0),N71(10.0),N72(10.0),N81(10.0),N92(10.0),EnrollDS(10.0),EnrollPD(10.0)
ZONES={lastin}
ZONEMSG=100
RO.zone = z ;set zone
RO.construc = ZI.1.cons ;construction
RO.manufac = ZI.1.manu ;manufacturing
RO.TCU = ZI.1.tcu ;TCU - transportation, communication, utilities
RO.wholesl = ZI.1.whol ;wholesale
RO.retail = ZI.1.retail ;retail
RO.FIRE = ZI.1.fire ;FIRE - finance, insurance, real estate
RO.service = ZI.1.serv ;service
RO.private = ZI.1.EMP - ZI.1.GOVT ;total private
RO.govt = ZI.1.govt ;government
RO.govt2 = ZI.1.govt ;government
RO.emp = ZI.1.emp ;total employment
RO.pop = ZI.2.pop ;population
RO.hshld = ZI.2.hh ;household
RO.univ = ZI.3.univ ;university enrollment
RO.acres = ZI.3.acres ;area - acres
RO.otherEmp = RO.construc + RO.manufac + RO.TCU + RO.wholesl + RO.FIRE + RO.govt
RO.district = ZI.5.distr
RO.PARKTOT = ZI.5.parkt
RO.PARKLNG = ZI.5.parkl
RO.PROPFREE = ZI.5.propf
RO.PARKRATE = ZI.5.parkr
RO.county = ZI.5.cnty
RO.cbdflag = ZI.5.cbd
;add NAICS employment codes
RO.N11 = ZI.1.N11
RO.N21 = ZI.1.N21
RO.N22 = ZI.1.N22
RO.N23 = ZI.1.N23
RO.N313233 = ZI.1.N313233
RO.N42 = ZI.1.N42
RO.N4445 = ZI.1.N4445
RO.N4849 = ZI.1.N4849
RO.N51 = ZI.1.N51
RO.N52 = ZI.1.N52
RO.N53 = ZI.1.N53
RO.N54 = ZI.1.N54
RO.N55 = ZI.1.N55
RO.N56 = ZI.1.N56
RO.N61 = ZI.1.N61
RO.N62 = ZI.1.N62
RO.N71 = ZI.1.N71
RO.N72 = ZI.1.N72
RO.N81 = ZI.1.N81
RO.N92 = ZI.1.N92
RO.ENROLLDS=ZI.4.ENROLLDS
RO.ENROLLPD=ZI.4.ENROLLPD
WRITE RECO=1
;create NWTAZ file required by other model components
PRINT LIST=ZI.1.TAZ(16.0),ZI.1.CONS(24.0),ZI.1.MANU(8.0),ZI.1.TCU(8.0),ZI.1.WHOL(8.0),ZI.1.RETAIL(8.0),ZI.1.FIRE(8.0),ZI.1.SERV(8.0),RO.PRIVATE(8.0),
ZI.1.GOVT(8.0),ZI.1.GOVT(24.0),ZI.1.EMP(8.0),ZI.2.POP(8.0),ZI.2.HH(8.0),ZI.3.UNIV(8.0),ZI.3.ACRES(8.0),FILE=NWTAZ{year}G.PRN
;create HSHLD file required by other model components
PRINT LIST=ZI.2.TAZ(5.0),ZI.2.I1H1(5.0),ZI.2.I1H2(5.0),ZI.2.I1H3(5.0),ZI.2.I1H4(5.0),ZI.2.I1H5(5.0),ZI.2.I1H6(5.0),
ZI.2.I2H1(5.0),ZI.2.I2H2(5.0),ZI.2.I2H3(5.0),ZI.2.I2H4(5.0),ZI.2.I2H5(5.0),ZI.2.I2H6(5.0),
ZI.2.I3H1(5.0),ZI.2.I3H2(5.0),ZI.2.I3H3(5.0),ZI.2.I3H4(5.0),ZI.2.I3H5(5.0),ZI.2.I3H6(5.0),
ZI.2.I4H1(5.0),ZI.2.I4H2(5.0),ZI.2.I4H3(5.0),ZI.2.I4H4(5.0),ZI.2.I4H5(5.0),ZI.2.I4H6(5.0),FILE=HSHLD{year}G.DAT
ENDRUN
;Household income percent for mode choice
;create DBF of households for lookup
RUN PGM=MATRIX
RECI=INPUTS\HOUSEHOLDS.CSV,DELIMITER=',' ZONE=5,INC=13,HHID=20
RECO=HOUSEHOLDS.DBF,FIELDS=RECI.ALLFIELDS
IF(RECI.RECNO>1)
WRITE RECO=1
_cnt=_cnt+1
ENDIF
ENDRUN
;read in zone data file (use # households as looping attribute for efficiency)
;accumulate # households by income group
RUN PGM=MATRIX
DBI[1]=ZoneData.DBF,SORT=ZONE
DBI[2]=HOUSEHOLDS.DBF,SORT=ZONE
RECO=TAZ_HHINC.DBF,FIELDS=TAZ,INC1,INC2,INC3,INC4
ZONES=1
LOOP ZNE=1,DBI.1.NUMRECORDS ;loop through all TAZs
x = DBIReadRecord(1,ZNE) ;read each individual TAZ
RO.TAZ=DI.1.ZONE
_INC1=0
_INC2=0
_INC3=0
_INC4=0
HSHLD=DI.1.HSHLD ;get TAZ level household # for looping
y = DBISeek(2,RO.TAZ) ;find TAZ number (no need to loop through all records)
_cnt = 1
LOOP HH=1,HSHLD ;loop through all households within a zone
x = DBIReadRecord(1,HH) ;read each individual household in zone
IF(_CNT=1)
IF(DI.2.ZONE=RO.TAZ)
IF(DI.2.INC<10000)
_INC1 = _INC1 + 1
ELSEIF(DI.2.INC<20000)
_INC2 = _INC2 + 1
ELSEIF(DI.2.INC<40000)
_INC3 = _INC3 + 1
ELSE
_INC4 = _INC4 + 1
ENDIF ;INC
ENDIF ;ZONE=TAZ
ENDIF ;CNT=1
IF(DBI.2.RECNO<DBI.2.NUMRECORDS) ;check on last record
w = DBIReadNext(2,1) ;read next record and accumulate auto results for each TAZ
_CNT = _CNT + 1
IF(DI.2.ZONE=RO.TAZ)
IF(DI.2.INC<10000)
_INC1 = _INC1 + 1
ELSEIF(DI.2.INC<20000)
_INC2 = _INC2 + 1
ELSEIF(DI.2.INC<40000)
_INC3 = _INC3 + 1
ELSE
_INC4 = _INC4 + 1
ENDIF ;INC
ENDIF ;ZONE=TAZ
ENDIF ;RECORD CHECK
ENDLOOP
RO.INC1=_INC1
RO.INC2=_INC2
RO.INC3=_INC3
RO.INC4=_INC4
WRITE RECO=1
ENDLOOP
ENDRUN
RUN PGM=MATRIX
RECI=TAZ_HHINC.DBF
RECO=TAZ_HHINC_PCT.DBF,FIELDS=TAZ,INC1,INC2,INC3,INC4,TOT,PCT1,PCT2,PCT3,PCT4
RO.TAZ=RI.TAZ
RO.INC1=RI.INC1
RO.INC2=RI.INC2
RO.INC3=RI.INC3
RO.INC4=RI.INC4
RO.TOT=RO.INC1+RO.INC2+RO.INC3+RO.INC4
IF(RO.TOT>0)
RO.PCT1=RO.INC1/RO.TOT*100
RO.PCT2=RO.INC2/RO.TOT*100
RO.PCT3=RO.INC3/RO.TOT*100
RO.PCT4=RO.INC4/RO.TOT*100
ELSE
RO.PCT1=0
RO.PCT2=0
RO.PCT3=0
RO.PCT4=0
ENDIF
WRITE RECO=1
ENDRUN
; write gdb network to binary network file
RUN PGM=NETWORK
NETI=inputs\arc_20{year}.gdb\arc{year}hwy
NETO="input.net"
ENDRUN
;build distance skim to test centroid connectivity
RUN PGM=HIGHWAY
NETI=INPUT.NET
MATO=TEST_CONN.SKM,MO=1,NAME=DISTANCE
ZONEMSG=50
PHASE=LINKREAD
IF(li.factype> 49) ADDTOGROUP=1 ; Transit only
ENDPHASE
PHASE=ILOOP
PATHLOAD PATH=DIST,MW[1]=PATHTRACE(DIST),NOACCESS=-1,excludegrp=1
ENDPHASE
ENDRUN
;run matrix step to check for connectivity
; return code = 3 for a manual abort
RUN PGM=MATRIX
MATI=TEST_CONN.SKM
ZONEMSG=50
abortflag=0
JLOOP
IF(I<>J) ;don't check intrazonals
IF(MI.1.1[J]<0)
PRINT LIST=I,J,FILE=CentroidCheck.PRN
abortflag=1
ENDIF
ENDIF
ENDJLOOP
IF(abortflag=1) ABORT MSG='Centroid not properly connected'
ENDRUN
RUN PGM=NETWORK
;write out node file
NETI=input.net
NODEI[2]=ZoneData.dbf,RENAME=ZONE-N
PRINTO[2]=STATION_ACCESS.DAT
PRINTO[3]=PT_PNR.DAT
PRINTO[4]=PT_PNR_INBOUND.DAT
PRINTO[5]=KNR_STATION.DAT
PRINTO[6]=KNR_STATION_INBOUND.DAT
NETO=arc{year}hwy1.tmp,
exclude=construc,manufac,tcu,wholesl,retail,fire,
service,govt,emp,pop,hshld,univ,acres,
OTHEREMP,DISTRICT,PARKTOT,PARKLNG,PROPFREE,PARKRATE
PHASE=NODEMERGE
IF(n<={lastin})
acres=NI.2.acres
ENDIF
; For generation of OUTBOUND/INBOUND KNR rail station connectors (jln 10/13/16 - update node print format to 6-digits)
IF(NI.1.staflag=1)
PRINT LIST='GENERATE,NTLEGMODE=2,COST=LI.DISTANCE,EXTRACTCOST=LI.TIME_1,MAXCOST=999*20 MAXNTLEGS=999*99,ONEWAY=T,DIRECTION=1,EXCLUDELINK=(LI.FACTYPE=99) FROMNODE=1-5922 TONODE=',NI.1.N(6.0),PRINTO=5
PRINT LIST='GENERATE,NTLEGMODE=2,COST=LI.DISTANCE,EXTRACTCOST=LI.TIME_1,MAXCOST=999*20 MAXNTLEGS=999*99,ONEWAY=T,DIRECTION=2,EXCLUDELINK=(LI.FACTYPE=99) FROMNODE=',NI.1.N(6.0),' TONODE=1-5922',PRINTO=6
ENDIF
ENDPHASE
PHASE=LINKMERGE
_ax=a.x
_ay=a.y
_bx=b.x
_by=b.y
;zero out external connector distances
IF(a={ext1}-{ext2}|| b={ext1}-{ext2})
distance=0
ENDIF
;set airport connectors to 1/4 mile
IF(a={airpt} | b={airpt})
distance=0.25
ENDIF
IF(DISTANCE>0)
WALKTIME=DISTANCE/2.5*60
ELSE
WALKTIME=0
ENDIF
; Write transit access/transfer links
IF(FACTYPE=53)
PRINT LIST='NT LEG=',A(6),'-',B(6),' MODE=4 COST=1 DIST=0.05 ONEWAY=F', PRINTO=2
ENDIF
; For generation of PNR OUTBOUND connectors
IF(FACTYPE=55 & A.PNR=1)
IF(A.PNR_MAJOR=1)
PRINT LIST='GENERATE,NTLEGMODE=3,COST=LI.TIME_1,MAXCOST=999*40,',"\n",
'ACCESSLINK=',A(6LR),'-',B(6LR),',',WALKTIME(10.2LR),',',DISTANCE(10.2LR),',',"\n",
'DIRECTION=1',',EXCLUDELINK=(LI.FACTYPE=4-6,99)',PRINTO=3
ELSE
PRINT LIST='GENERATE,NTLEGMODE=3,COST=LI.TIME_1,MAXCOST=999*10,',"\n",
'ACCESSLINK=',A(6LR),'-',B(6LR),',',WALKTIME(10.2LR),',',DISTANCE(10.2LR),',',"\n",
'DIRECTION=1',',EXCLUDELINK=(LI.FACTYPE=4-6,99)',PRINTO=3
ENDIF
ENDIF
; For generation of PNR INBOUND connectors
IF(FACTYPE=55 & A.PNR=1)
IF(A.PNR_MAJOR=1)
PRINT LIST='GENERATE,NTLEGMODE=3,COST=LI.TIME_1,MAXCOST=999*40,',"\n",
'ACCESSLINK=',A(6LR),'-',B(6LR),',',WALKTIME(10.2LR),',',DISTANCE(10.2LR),',',"\n",
'DIRECTION=2',',EXCLUDELINK=(LI.FACTYPE=4-6,99)',PRINTO=4
ELSE
PRINT LIST='GENERATE,NTLEGMODE=3,COST=LI.TIME_1,MAXCOST=999*10,',"\n",
'ACCESSLINK=',A(6LR),'-',B(6LR),',',WALKTIME(10.2LR),',',DISTANCE(10.2LR),',',"\n",
'DIRECTION=2',',EXCLUDELINK=(LI.FACTYPE=4-6,99)',PRINTO=4
ENDIF
ENDIF
ENDPHASE
ENDRUN
IF({chkATy.n}=0) goto :CheckBuildNets
; DETERMINE HIGHWAY AREA TYPES
; Use the NETWORK module to find the closest TAZ to each link midpoint
; Add the closest TAZ based on a-node / b-node in addition to midpoint
RUN PGM=NETWORK
NETI=arc{Year}hwy1.tmp
NETO=tempnet.tmp
; set the highest node number as maximum zones
ZONES={totzones}
array _centn={lastin},_centx={lastin},_centy={lastin}
; put centroid number and coordinates into arrays
PHASE=NODEMERGE
IF(n<={lastin})
_cnt=_cnt+1
_centn[_cnt]=n
_centx[_cnt]=x
_centy[_cnt]=y
ENDIF
ENDPHASE
; process each link and find the nearest TAZ centroid to each link midpoint
PHASE=LINKMERGE
; determine link midpoint
_ax=a.x
_ay=a.y
_bx=b.x
_by=b.y
_midptx=(_ax+_bx)/2
_midpty=(_ay+_by)/2
; initialize variables
_min_dist=999999
_min_dist2=999999
_closest=0
_closest2=0
TAZ=0
TAZ2=0
; find nearest centroid
LOOP _index=1,_cnt ; loop through each centroid
; calculate the distance between the link midpoint and TAZ centroid
_dist=sqrt((_midptx-_centx[_index])^2 +(_midpty-_centy[_index])^2)
; save info if TAZ centroid is closer than previous centroid
IF(_dist < _min_dist)
_min_dist=_dist
_closest=_index
ENDIF
IF(_closest > 0) TAZ=_closest ; If near TAZ is found
; calculate the distance between the link anode and TAZ centroid
_dist2=sqrt((_ax-_centx[_index])^2 +(_ay-_centy[_index])^2)
; save info if TAZ centroid is closer than previous centroid
IF(_dist2 < _min_dist2)
_min_dist2=_dist2
_closest2=_index
ENDIF
IF(_closest2 > 0) TAZ2=_closest2 ; If near TAZ is found
ENDLOOP
; Set external station link TAZ to station number
IF(a={ext1}-{ext2})
TAZ=a
ENDIF
IF(b={ext1}-{ext2})
TAZ=b
ENDIF
ENDPHASE
ENDRUN
; Use the NETWORK module to accumulate SE data for each TAZ based on a floating zone
; methodology. This method would accumulate SE data (as well as acreage) for all
; the TAZ's within a preset distance (1 mile) of that TAZ. Then this data
; will be used to calculate the population and employement density for that TAZ. This
; method allows for a smoother transition between area types for links.
RUN PGM=NETWORK
NETI[1]=tempnet.tmp ; network with TAZ on links
; read in the zonal SE data file in fixed format
NODEI[2]=ZoneData.dbf,RENAME=ZONE-N
NETO=arc{year}hy_A.net
array _centn={totzones},_centx={totzones},_centy={totzones},
_pop={totzones},_totemp={totzones},_acres={totzones},_totpopemp={totzones},
_fltpop={totzones},_fltemp={totzones},_fltacres={totzones},
_poplu={totzones},_emplu={totzones},_totlu={totzones},
_const={totzones},_manuf={totzones},_tcu={totzones},
_whole={totzones},_retail={totzones},_fire={totzones},
_service={totzones},_govt={totzones},
_fltconst={totzones},_fltmanuf={totzones},_flttcu={totzones},
_fltwhole={totzones},_fltretail={totzones},_fltfire={totzones},
_fltservice={totzones},_fltgovt={totzones},_ntrnflag={totzones},
_density={totzones},_park={totzones},_autozone={totzones},_fltpopemp={totzones}
; put centroid number and coordinates into arrays
PHASE=NODEMERGE
IF(n<={totzones})
_cnt=_cnt+1
_centn[_cnt]=n
_centx[_cnt]=x
_centy[_cnt]=y
_pop[_cnt]=pop
_totemp[_cnt]=emp
_acres[_cnt]=acres
; ARC employment category arrays
_const[_cnt]=CONSTRUC
_manuf[_cnt]=MANUFAC
_tcu[_cnt]=tcu
_whole[_cnt]=WHOLESL
_retail[_cnt]=retail
_fire[_cnt]=fire
_service[_cnt]=service
_govt[_cnt]=govt
; initialize floating zone arrays
_fltpop[_cnt]=0
_fltemp[_cnt]=0
_fltacres[_cnt]=0
_fltpopemp[n]=0
; ARC employment category floating zone arrays
_fltconst[_cnt]=0
_fltmanuf[_cnt]=0
_flttcu[_cnt]=0
_fltwhole[_cnt]=0
_fltretail[_cnt]=0
_fltfire[_cnt]=0
_fltservice[_cnt]=0
_fltgovt[_cnt]=0
ENDIF
ENDPHASE
PHASE=LINKMERGE
_linkcnt=_linkcnt+1
; loop thru centroids to accumulate floating zone data
IF(_linkcnt=1)
LOOP _taz=1,{totzones}
LOOP _taz2=1,{totzones}
IF(_taz<={totzones} & _centn[_taz]>0)
; calculate the distance between the subject TAZ and other TAZs
_dist=sqrt((_centx[_taz]-_centx[_taz2])^2 +(_centy[_taz]-_centy[_taz2])^2)
; save info if less than previous nodes
IF(_dist <= 3960)
_tmppop=_fltpop[_taz]+_pop[_taz2]
_fltpop[_taz]=_tmppop
_tmpemp=_fltemp[_taz]+_totemp[_taz2]
_fltemp[_taz]=_tmpemp
_tmpacres=_fltacres[_taz]+_acres[_taz2]
_fltacres[_taz]=_tmpacres
_fltpopemp[_taz]=_tmppop+_tmpemp
; ARC employment categories
_tmpconst=_fltconst[_taz]+_const[_taz2]
_fltconst[_taz]=_tmpconst
_tmpmanuf=_fltmanuf[_taz]+_manuf[_taz2]
_fltmanuf[_taz]=_tmpmanuf
_tmptcu=_flttcu[_taz]+_tcu[_taz2]
_flttcu[_taz]=_tmptcu
_tmpwhole=_fltwhole[_taz]+_whole[_taz2]
_fltwhole[_taz]=_tmpwhole
_tmpretail=_fltretail[_taz]+_retail[_taz2]
_fltretail[_taz]=_tmpretail
_tmpfire=_fltfire[_taz]+_fire[_taz2]
_fltfire[_taz]=_tmpfire
_tmpservice=_fltservice[_taz]+_service[_taz2]
_fltservice[_taz]=_tmpservice
_tmpgovt=_fltgovt[_taz]+_govt[_taz2]
_fltgovt[_taz]=_tmpgovt
ENDIF
ENDIF
ENDLOOP
; write out the accumulated SE data and acreage for each TAZ
PRINT form=8.0, file=fltzone.txt,list=_taz,_fltconst[_taz],_fltmanuf[_taz],_flttcu[_taz],_fltwhole[_taz],
_fltretail[_taz],_fltfire[_taz],_fltservice[_taz],_fltgovt[_taz],_fltpop[_taz],_fltemp[_taz],_fltpopemp[_taz],_fltacres[_taz](10.2),
_pop[_taz],_totemp[_taz],_acres[_taz](11.3),_centx[_taz](9),_centy[_taz](9)
_tmppop=0
_tmpemp=0
_tmpacres=0
_tmpconst=0
_tmpmanuf=0
_tmptcu=0
_tmpwhole=0
_tmpretail=0
_tmpfire=0
_tmpservice=0
_tmpgovt=0
ENDLOOP
ENDIF
; Lookup Area Type using Floating Zone Data and Link TAZ
Lookup Name=_AreaType,
Lookup[1]=1, Result=2, ; Area Type for Employment Density Group 1
Lookup[2]=1, Result=3, ; Area Type for Employment Density Group 2
Lookup[3]=1, Result=4, ; Area Type for Employment Density Group 3
Lookup[4]=1, Result=5, ; Area Type for Employment Density Group 4
Lookup[5]=1, Result=6, ; Area Type for Employment Density Group 5
Lookup[6]=1, Result=7, ; Area Type for Employment Density Group 6
Lookup[7]=1, Result=8, ; Area Type for Employment Density Group 7
Fail=-1,-1,-1, Interpolate=N, ; returns -1 if fail, no interpolation
; ------- Lookup data starts here:
; Employment Density Group
; -----------------------------
; Pop 1 2 3 4 5 6 7
; Group
; -----------------------------
R=' 1 7 7 6 4 4 3 2',
' 2 7 6 6 4 3 3 2',
' 3 7 6 5 4 3 2 2',
' 4 6 5 5 4 3 2 2',
' 5 6 5 5 4 3 2 1',
' 6 5 5 5 3 3 2 1',
' 7 5 5 5 3 2 2 1'
IF(_linkcnt=1)
LOOP _t=1,{totzones}
_pop=_fltpop[_t]
_totemp=_fltemp[_t]
_acres=_fltacres[_t]
IF(_fltacres[_t]=0) ; this is a check for TAZ's that have no socieconomic data and are just
_popdensity=0 ; placeholders or "dummy zones" to be used in future model updates
_empdensity=0
_new_val=0
_retden=0
_comden=0
_indden=0
ELSE
; Calulate employment density based on factors for different types of employment
_retail=_fltretail[_t]
_commercial=_fltfire[_t]+_fltservice[_t]+_fltgovt[_t]
_industrial=_fltconst[_t]+_fltmanuf[_t]+_flttcu[_t]+_fltwhole[_t]
_emp_val=(10*_retail) + _commercial + (0.3*_industrial)
_retden=_retail/_fltacres[_t]
_comden=_commercial/_fltacres[_t]
_indden=_industrial/_fltacres[_t]
_totpopemp=((10*_retail) + _commercial + (0.3*_industrial)) + (_fltpop[_t])
_tmpempchk=((10*_retail) + _commercial + (0.3*_industrial))
_new_val=_totpopemp/_fltacres[_t]
PRINT list=_t(6),_retail(6),_commercial(6),_industrial(6),_tmpempchk(6),_fltpop[_t](8),_totpopemp(8),_fltacres[_t](8.0),_new_val(8.2),file=temp.txt
; Airport Adjustments
IF(_t= {airpt})
_popdensity=round((_fltpop[_t]/(_fltacres[_t]*0.25))*100)/100
_empdensity=round((_emp_val/(_fltacres[_t]*0.25))*100)/100
_new_val=round((_totpopemp*0.25)*100)/100
ELSE
_popdensity=round((_fltpop[_t]/_fltacres[_t])*100)/100
_empdensity=round((_emp_val/_fltacres[_t])*100)/100
ENDIF
ENDIF
; set adjustment for total pop+emp
IF(_new_val<=0.50)
_totlu[_t]=7
ELSEIF(_new_val<=1.50)
_totlu[_t]=6
ELSEIF(_new_val<=9.00)
_totlu[_t]=5
ELSEIF(_new_val<=15.00)
_totlu[_t]=4
ELSEIF(_new_val<=25.00) ;5.4
_totlu[_t]=3
ELSEIF(_new_val<=48.00) ;8.07
_totlu[_t]=2
ELSEIF(_new_val>48.00) ;8.07
_totlu[_t]=1
ENDIF
; set population density lookup value
IF(_popdensity<=0.32) ;.43
_poplu[_t]=1
ELSEIF(_popdensity<=0.60) ;78
_poplu[_t]=2
ELSEIF(_popdensity<=1.89) ;2.38
_poplu[_t]=3
ELSEIF(_popdensity<=3.28) ;3.48
_poplu[_t]=4
ELSEIF(_popdensity<=5.21) ;5.4
_poplu[_t]=5
ELSEIF(_popdensity<=8.67) ;8.07
_poplu[_t]=6
ELSEIF(_popdensity>8.67) ;8.07
_poplu[_t]=7
ENDIF
; set empdensity lookup value
IF(_empdensity<=0.05) ;.05
_emplu[_t]=1
ELSEIF(_empdensity<=0.21) ;.32
_emplu[_t]=2
ELSEIF(_empdensity<=6.10) ;6.65
_emplu[_t]=3
ELSEIF(_empdensity<=11.61) ;12.44
_emplu[_t]=4
ELSEIF(_empdensity<=20.00) ;25.1
_emplu[_t]=5
ELSEIF(_empdensity<=33.04) ;57.97
_emplu[_t]=6
ELSEIF(_empdensity>33.04) ;57.97
_emplu[_t]=7
ENDIF
; adjustment for Dobbins - set area type same as adjacent zone
_dobbins={dobbins}-1
IF(_t=_dobbins)
_savtotlu=_totlu[_t]
ENDIF
IF(_t={dobbins})
_totlu[_t]=_savtotlu
ENDIF
; adjustments for externals stations - make all links rural, class 7
IF(_t=@externals@)
_totlu[_t]=7
ENDIF
; Flag non-transit friendly zones - no longer used
IF(_t>0)
_ntrnflag[_t] = 1