1 Exemplo

library(travelr)
## travelr is SERIOUSLY in a 'pre-alpha' state... Lots of Luck!
m<-matrix(c(5,50,100,200,
            50,5,100,300,
            50,100,5,100,
            100,200,250,20),
          nrow=4,ncol=4,byrow=TRUE)
dimnames(m)<-list(Rows=c("R1","R2","R3","R4"),Cols=c("C1","C2","C3","C4"))
df = as.data.frame(addmargins(m))
df
f<-c(400,460,400,702)

mf.vector<-ipf(m,f,"absolute")
print(mf.vector)
##      Cols
## Rows          C1         C2         C3       C4  Sum
##   R1    9.655253  61.332644  89.958941 239.0532  400
##   R2   80.573641   5.118244  75.071254 299.2369  460
##   R3  112.518202 142.948899   5.241716 139.2912  400
##   R4  197.252903 250.600212 229.728088  24.4188  702
##   Sum 400.000000 460.000000 400.000000 702.0000 1962
## RMSE: 3.210344e-08 
## Converged in 18 Iterations
f.1<-list(rows=c(400,460,400,702))
mf.list.1<-ipf(m,f.1,"absolute")
## Warning in ipf(m, f.1, "absolute"): Not enough growth factor vectors for 2
## dimensions: recycling
print(mf.list.1)
##      Cols
## Rows          C1         C2         C3       C4  Sum
##   R1    9.655253  61.332644  89.958941 239.0532  400
##   R2   80.573641   5.118244  75.071254 299.2369  460
##   R3  112.518202 142.948899   5.241716 139.2912  400
##   R4  197.252903 250.600212 229.728088  24.4188  702
##   Sum 400.000000 460.000000 400.000000 702.0000 1962
## RMSE: 3.210344e-08 
## Converged in 18 Iterations
f.2<-list(rows=c(400,460,400,702),cols=c(260,400,500,802))
mf.list.2<-ipf(m,f.2,"absolute")
print(mf.list.2)
##      Cols
## Rows          C1         C2         C3        C4  Sum
##   R1    5.195016  43.599107  97.186482 254.01939  400
##   R2   44.707064   3.752035  83.636365 327.90454  460
##   R3   76.674278 128.697592   7.171974 187.45616  400
##   R4  133.423642 223.951265 312.005179  32.61991  702
##   Sum 260.000000 400.000000 500.000000 802.00000 1962
## RMSE: 5.744356e-08 
## Converged in 20 Iterations
df.1<-data.frame(rows=c(400,460,400,702),cols=c(260,400,500,802))
mf.df.1<-ipf(m,df.1,"absolute")
print(mf.df.1)
##      Cols
## Rows          C1         C2         C3        C4  Sum
##   R1    5.195016  43.599107  97.186482 254.01939  400
##   R2   44.707064   3.752035  83.636365 327.90454  460
##   R3   76.674278 128.697592   7.171974 187.45616  400
##   R4  133.423642 223.951265 312.005179  32.61991  702
##   Sum 260.000000 400.000000 500.000000 802.00000 1962
## RMSE: 5.744356e-08 
## Converged in 20 Iterations
f.pct<-c(102,105,110,95)
mf.pct<-ipf(m,f.pct,"percent")
print(mf.pct)
##      Cols
## Rows         C1         C2         C3        C4       Sum
##   R1    5.34967  56.447730 118.765199 183.60735  364.1700
##   R2   56.70229   5.983015 125.881758 291.91400  480.4811
##   R3   57.13615 120.575886   6.342247  98.04920  282.1035
##   R4   89.91189 189.743369 249.510796  15.42944  544.5955
##   Sum 209.10000 372.750000 500.500000 589.00000 1671.3500
## RMSE: 2.477394 
## All 50 Iterations Completed

1.1 SiouxFalls

data(SiouxFalls)
#https://github.com/bstabler/TransportationNetworks/tree/master/SiouxFalls

1.1.1 Matriz OD

SiouxFalls.od
##         X1  X2  X3   X4   X5  X6   X7   X8   X9  X10  X11  X12  X13  X14  X15
##  [1,]    0 100 100  500  200 300  500  800  500 1300  500  200  500  300  500
##  [2,]  100   0 100  200  100 400  200  400  200  600  200  100  300  100  100
##  [3,]  100 100   0  200  100 300  100  200  100  300  300  200  100  100  100
##  [4,]  500 200 200    0  500 400  400  700  700 1200 1400  600  600  500  500
##  [5,]  200 100 100  500    0 200  200  500  800 1000  500  200  200  100  200
##  [6,]  300 400 300  400  200   0  400  800  400  800  400  200  200  100  200
##  [7,]  500 200 100  400  200 400    0 1000  600 1900  500  700  400  200  500
##  [8,]  800 400 200  700  500 800 1000    0  800 1600  800  600  600  400  600
##  [9,]  500 200 100  700  800 400  600  800    0 2800 1400  600  600  600  900
## [10,] 1300 600 300 1200 1000 800 1900 1600 2800    0 4000 2000 1900 2100 4000
## [11,]  500 200 300 1500  500 400  500  800 1400 3900    0 1400 1000 1600 1400
## [12,]  200 100 200  600  200 200  700  600  600 2000 1400    0 1300  700  700
## [13,]  500 300 100  600  200 200  400  600  600 1900 1000 1300    0  600  700
## [14,]  300 100 100  500  100 100  200  400  600 2100 1600  700  600    0 1300
## [15,]  500 100 100  500  200 200  500  600 1000 4000 1400  700  700 1300    0
## [16,]  500 400 200  800  500 900 1400 2200 1400 4400 1400  700  600  700 1200
## [17,]  400 200 100  500  200 500 1000 1400  900 3900 1000  600  500  700 1500
## [18,]  100   0   0  100    0 100  200  300  200  700  200  200  100  100  200
## [19,]  300 100   0  200  100 200  400  700  400 1800  400  300  300  300  800
## [20,]  300 100   0  300  100 300  500  900  600 2500  600  500  600  500 1100
## [21,]  100   0   0  200  100 100  200  400  300 1200  400  300  600  400  800
## [22,]  400 100 100  400  200 200  500  500  700 2600 1100  700 1300 1200 2600
## [23,]  300   0 100  500  100 100  200  300  500 1800 1300  700  800 1100 1000
## [24,]  100   0   0  200    0 100  100  200  200  800  600  500  700  400  400
##        X16  X17 X18  X19  X20  X21  X22  X23  X24
##  [1,]  500  400 100  300  300  100  400  300  100
##  [2,]  400  200   0  100  100    0  100    0    0
##  [3,]  200  100   0    0    0    0  100  100    0
##  [4,]  800  500 100  200  300  200  400  500  200
##  [5,]  500  200   0  100  100  100  200  100    0
##  [6,]  900  500 100  200  300  100  200  100  100
##  [7,] 1400 1000 200  400  500  200  500  200  100
##  [8,] 2200 1400 300  700  900  400  500  300  200
##  [9,] 1400  900 200  400  600  300  700  500  200
## [10,] 4400 3900 700 1800 2500 1200 2600 1800  800
## [11,] 1400 1000 100  400  600  400 1100 1300  600
## [12,]  700  600 200  300  400  300  700  700  500
## [13,]  600  500 100  300  600  600 1300  800  800
## [14,]  700  700 100  300  500  400 1200 1100  400
## [15,] 1200 1500 200  800 1100  800 2600 1000  400
## [16,]    0 2800 500 1300 1600  600 1200  500  300
## [17,] 2800    0 600 1700 1700  600 1700  600  300
## [18,]  500  600   0  300  400  100  300  100    0
## [19,] 1300 1700 300    0 1200  400 1200  300  100
## [20,] 1600 1700 400 1200    0 1200 2400  700  400
## [21,]  600  600 100  400 1200    0 1800  700  500
## [22,] 1200 1700 300 1200 2400 1800    0 2100 1100
## [23,]  500  600 100  300  700  700 2100    0  700
## [24,]  300  300   0  100  400  500 1100  700    0

1.1.2 Número de Nós

SiouxFalls.net$numNodes
## [1] 24

Gráfico de Centróides

plot(SiouxFalls.net$nodes$X, SiouxFalls.net$nodes$Y)

1.1.3 Número de Conectores

SiouxFalls.net$numLinks
## [1] 76

1.1.3.1 Número de Zonas

SiouxFalls.net$numZones
## [1] 24

1.1.4 Custos

SiouxFalls.net$Penalty

1.1.6 Geração de Viagens

A geração de viagens fornece o número de viagens entr pares OD na atualidade.

1.1.6.1 Produção

productions<-rowSums(SiouxFalls.od)
productions
##  [1]  8800  4000  2800 11600  6100  7600 12100 16700 16200 45200 22300 13900
## [13] 14600 14100 21400 26100 23400  4800 12800 18500 11000 24400 14500  7700

1.1.6.2 Atração

attractions<-colSums(SiouxFalls.od)
attractions
##    X1    X2    X3    X4    X5    X6    X7    X8    X9   X10   X11   X12   X13 
##  8800  4000  2800 11700  6100  7600 12100 16700 16300 45100 22400 14000 14500 
##   X14   X15   X16   X17   X18   X19   X20   X21   X22   X23   X24 
## 14100 21300 26100 23400  4700 12800 18400 11000 24400 14500  7800

1.1.7 Parametros

cost.function<-with(SiouxFalls.net$Links,function(...)FFTime)
aclass <- make.assignment.class(SiouxFalls.net,"All",SiouxFalls.od)
aset <- new.assignment.set(SiouxFalls.net,list(All=aclass),cost.volume.type="vector",cost.function=cost.function)
paths <- build.paths(aset,aset$ff.cost)
travel.times <- skim.paths(paths,aset$ff.cost)[["All"]] # Popósito unico de viagem
travel.times
##         [,1]   [,2]   [,3]   [,4]   [,5]   [,6]   [,7]   [,8]   [,9]  [,10]
##  [1,]  0.000  5.973  4.199  8.199 10.341 10.914 15.749 12.780 15.370 18.465
##  [2,]  6.181  0.000 10.380 10.680  8.789  4.941  9.776  6.807 13.818 15.657
##  [3,]  4.131 10.104  0.000  4.000  6.142 10.054 14.889 11.920 11.171 14.266
##  [4,]  8.061 11.051  3.930  0.000  2.142  6.054 10.889  7.920  7.171 10.266
##  [5,]  9.952  8.909  5.821  1.891  0.000  3.912  8.747  5.778  5.029  8.124
##  [6,] 11.178  4.997  9.669  5.739  3.848  0.000  4.835  1.866  8.877 10.716
##  [7,] 16.379 10.198 14.870 10.940  9.049  5.201  0.000  3.048 11.838  8.889
##  [8,] 13.331  7.150 11.822  7.892  6.001  2.153  2.969  0.000  9.929  8.850
##  [9,] 14.764 13.721 10.633  6.703  4.812  8.724 12.081  9.818  0.000  3.095
## [10,] 17.713 16.204 13.582  9.652  7.761 11.207  8.986  9.054  2.949  0.000
## [11,] 14.112 17.205  9.981  6.154  8.296 12.208 14.176 14.074  8.139  5.190
## [12,]  8.298 14.271  4.167  8.167 10.309 14.221 19.056 16.087 14.005 11.056
## [13,] 11.340 17.313  7.209 11.209 13.351 17.263 19.550 19.129 17.047 14.098
## [14,] 18.264 21.357 14.133 10.306 12.448 16.360 16.888 16.956 12.291  9.342
## [15,] 23.406 19.167 19.275 15.466 13.787 14.170 11.949 12.017  8.975  6.026
## [16,] 18.459 12.278 16.950 13.020 11.129  7.281  5.060  5.128  6.964  4.015
## [17,] 20.611 14.430 19.102 15.172 13.281  9.433  7.212  7.280  9.116  6.167
## [18,] 18.576 12.395 17.067 13.137 11.246  7.398  2.197  5.245  9.910  6.961
## [19,] 22.502 16.321 20.993 17.063 15.172 11.324  9.103  9.171 11.007  8.058
## [20,] 22.447 16.266 19.978 17.008 15.117 11.269  6.068  9.116 13.781 10.832
## [21,] 18.227 22.454 14.096 18.096 18.736 17.457 12.256 15.304 13.924 10.975
## [22,] 20.299 21.074 16.168 18.238 16.875 16.077 10.876 13.924 12.063  9.114
## [23,] 17.320 23.293 13.189 14.159 16.301 20.213 15.020 18.068 16.144 13.195
## [24,] 15.273 21.246 11.142 15.142 17.284 20.643 15.442 18.490 17.110 14.161
##        [,11]  [,12]  [,13]  [,14]  [,15]  [,16]  [,17]  [,18]  [,19]  [,20]
##  [1,] 13.997  8.131 11.219 18.130 23.069 17.615 19.778 17.677 21.917 21.522
##  [2,] 16.820 14.312 17.400 20.953 18.744 11.642 13.805 11.704 15.944 15.549
##  [3,]  9.798  3.932  7.020 13.931 18.870 16.755 18.918 16.817 21.057 20.502
##  [4,]  6.140  7.862 10.950 10.273 15.212 12.755 14.918 12.817 17.057 16.662
##  [5,]  8.031  9.753 12.841 12.164 14.148 10.613 12.776 10.675 14.915 14.520
##  [6,] 11.879 13.601 16.689 16.012 13.803  6.701  8.864  6.763 11.003 10.608
##  [7,] 13.873 18.802 18.542 17.136 11.976  4.874  7.037  1.928  9.176  5.773
##  [8,] 13.834 15.754 18.842 17.097 11.937  4.835  6.998  4.897  9.137  8.742
##  [9,]  8.079 13.893 16.981 12.212  9.119  7.021  9.184  9.884 11.323 13.729
## [10,]  4.984 10.798 13.886  9.117  6.024  3.926  6.089  6.789  8.228 10.634
## [11,]  0.000  5.814  8.902  4.133  9.072  9.116 11.279 11.979 11.918 15.824
## [12,]  5.866  0.000  3.088  9.999 14.938 14.982 17.145 17.845 17.784 16.570
## [13,]  8.908  3.042  0.000  9.911 12.243 18.024 16.980 17.353 15.089 13.482
## [14,]  4.152  9.966  9.968  0.000  4.939 11.828  9.676 14.691  7.785 11.713
## [15,]  9.312 15.108 12.066  5.160  0.000  6.889  4.737  9.752  2.846  6.774
## [16,]  8.999 14.813 17.901 12.262  7.102  0.000  2.163  2.863  4.302  6.708
## [17,] 11.151 16.965 17.005 10.099  4.939  2.152  0.000  5.015  2.139  6.067
## [18,] 11.945 17.759 16.614 15.208 10.048  2.946  5.109  0.000  7.248  3.845
## [19,] 12.112 17.908 14.866  7.960  2.800  4.043  1.891  6.906  0.000  3.928
## [20,] 15.816 15.811 12.769 11.859  6.699  6.817  5.790  3.871  3.899  0.000
## [21,] 12.909  9.929  6.887  8.757  4.949 11.838  9.686 10.059  7.795  6.188
## [22,] 12.084 12.001  8.959  7.932  3.088  9.977  7.825  8.679  5.934  4.808
## [23,]  8.005  9.022  5.980  3.853  7.232 14.121 11.969 12.823 10.078  8.952
## [24,]  9.955  6.975  3.933  5.803  8.135 15.024 12.872 13.245 10.981  9.374
##        [,21]  [,22]  [,23]  [,24]
##  [1,] 18.513 20.374 17.277 15.327
##  [2,] 21.431 20.461 23.458 21.508
##  [3,] 14.314 16.175 13.078 11.128
##  [4,] 18.244 18.319 14.261 15.058
##  [5,] 19.327 17.255 16.152 16.949
##  [6,] 16.490 15.520 19.599 19.444
##  [7,] 11.655 10.685 14.764 14.609
##  [8,] 14.624 13.654 17.733 17.578
##  [9,] 14.298 12.226 16.200 17.252
## [10,] 11.203  9.131 13.105 14.157
## [11,] 13.354 12.179  8.121 10.168
## [12,] 10.382 12.243  9.146  7.196
## [13,]  7.294  9.155  6.058  4.108
## [14,]  9.221  8.046  3.988  6.035
## [15,]  5.179  3.107  7.186  8.133
## [16,] 12.281 10.209 14.288 15.235
## [17,] 10.118  8.046 12.125 13.072
## [18,]  9.727  8.757 12.836 12.681
## [19,]  7.979  5.907  9.986 10.933
## [20,]  5.882  4.912  8.991  8.836
## [21,]  0.000  1.861  4.904  2.954
## [22,]  2.072  0.000  4.079  5.026
## [23,]  5.233  4.144  0.000  2.047
## [24,]  3.186  5.047  1.950  0.000

1.1.8 Distribuição de Viagens (Modelo Gravitacional e Função Gama)

A distribução de viagens compreende a etapa em que são estimados os valores futuros de viagens entre zonas dos pares OD. sempre considerando as potencialidades de atração e produção de viagens, bem como os custos associados aos trajetos entre os pares OD.

base.distribution <- hwy.gamma.function(travel.times,-0.02,-0.123) # HBW coefficients from NCHRP 365
trip.table <- ipf(base.distribution,list(rows=productions, cols=attractions),method="absolute")
aset <- hwy.update.demand(aset,"All",trip.table)
aset
## $network
## Highway Network:
##   Nodes: 24 Links: 76 Zones: 24 
##   First Through Node: 1 
## 
## $penalties
## [1] -1
## 
## $cost.function
## function (volume, aset) 
## {
##     as.data.frame(cost.function(cost.volume(volume), aset))
## }
## <bytecode: 0x564acbf4e6f0>
## <environment: 0x564acbf4cfc0>
## 
## $classes
## $classes$All
## $name
## [1] "All"
## 
## $network.set
## $edges
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## A       0    0    1    1    2    2    2    3    3     3     4     4     4     5
## B       1    2    0    5    0    3   11    2    4    10     3     5     8     1
## Link    0    1    2    3    4    5    6    7    8     9    10    11    12    13
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26]
## A        5     5     6     6     7     7     7     7     8     8     8     9
## B        4     7     7    17     5     6     8    15     4     7     9     8
## Link    14    15    16    17    18    19    20    21    22    23    24    25
##      [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38]
## A        9     9     9     9    10    10    10    10    11    11    11    12
## B       10    14    15    16     3     9    11    13     2    10    12    11
## Link    26    27    28    29    30    31    32    33    34    35    36    37
##      [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50]
## A       12    13    13    13    14    14    14    14    15    15    15    15
## B       23    10    14    22     9    13    18    21     7     9    16    17
## Link    38    39    40    41    42    43    44    45    46    47    48    49
##      [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [,61] [,62]
## A       16    16    16    17    17    17    18    18    18    19    19    19
## B        9    15    18     6    15    19    14    16    19    17    18    20
## Link    50    51    52    53    54    55    56    57    58    59    60    61
##      [,63] [,64] [,65] [,66] [,67] [,68] [,69] [,70] [,71] [,72] [,73] [,74]
## A       19    20    20    20    21    21    21    21    22    22    22    23
## B       21    19    21    23    14    19    20    22    13    21    23    12
## Link    62    63    64    65    66    67    68    69    70    71    72    73
##      [,75] [,76]
## A       23    23
## B       20    22
## Link    74    75
## attr(,"numNodes")
## [1] 24
## attr(,"numZones")
## [1] 24
## attr(,"numLinks")
## [1] 76
## attr(,"firstThruNode")
## [1] 0
## 
## $turns
##        [,1]
## Node     -1
## Parent   -1
## Child    -1
## Turn     -1
## 
## $offsets
##         [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
## NODE       0    1    2    3    4    5    6    7    8     9    10    11    12
## Start      0    2    4    7   10   13   16   18   22    25    30    34    37
## End        2    4    7   10   13   16   18   22   25    30    34    37    39
## TurnOn     0    0    0    0    0    0    0    0    0     0     0     0     0
## TurnOff    0    0    0    0    0    0    0    0    0     0     0     0     0
##         [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## NODE       13    14    15    16    17    18    19    20    21    22    23
## Start      39    42    46    50    53    56    59    63    66    70    73
## End        42    46    50    53    56    59    63    66    70    73    76
## TurnOn      0     0     0     0     0     0     0     0     0     0     0
## TurnOff     0     0     0     0     0     0     0     0     0     0     0
## 
## attr(,"class")
## [1] "highway.network.set"
## 
## $demand
##                                                                       
##        0.00000  507.55977  324.83890   767.30831  276.09426  336.39498
##      481.47700    0.00000   55.30066   208.56643  124.30146  264.18079
##      332.87530   59.71046    0.00000   257.81426   92.40287   74.01197
##      788.77789  206.58493  258.71759     0.00000  601.06520  476.20531
##      288.20157  125.01952   94.18590   611.60733    0.00000  289.46418
##      314.05180  259.88251   73.76149   473.23977  283.19948    0.00000
##      259.27245  213.13486   60.83656   388.64327  231.60007  492.00720
##      535.56929  441.58007  125.72679   804.74550  480.37127 1030.15629
##      412.18597  178.66908  134.14530   859.61475  513.71462  410.63053
##      769.58817  353.38207  250.14755  1599.13025  953.49194  810.80346
##      611.22807  158.43971  198.99533  1259.68453  452.65892  363.33955
##      958.21796  173.09810  314.10771   741.90447  266.94907  214.55135
##      735.46078  133.17476  239.95266   569.38485  205.11172  165.06520
##      235.92023   61.20521   76.66969   483.71013  174.20014  140.14317
##      159.13724  102.45939   51.65231   324.53323  188.13598  234.77069
##      357.01722  293.09840   83.75267   534.57728  318.35581  674.56001
##      257.43384  211.12757   60.38023   385.13779  229.25118  484.95975
##       65.47779   53.75153   15.36026    98.03757   58.38237  123.69208
##      106.20778   87.04192   24.90738   158.79946   94.49492  199.69713
##      186.30341  152.68664   49.21338   278.56099  165.76134  350.31389
##      174.68553   39.37777   56.77022   135.22751   58.76258   90.13762
##      298.77171  103.32836   97.03918   293.84077  163.72730  236.61311
##      283.72042   51.50562   92.23348   320.06898  115.37812   92.92921
##      188.41857   34.18175   61.30476   145.86262   52.58941   45.37254
## Sum 8800.00000 4000.00000 2800.00000 11700.00000 6100.00000 7600.00000
##                                                                        
##       280.66070   576.4649   379.5857   697.3755   607.6058   950.04033
##       219.02404   451.2453   170.7029   366.4369   158.6090   162.83741
##        61.71758   126.7995   126.5274   232.1724   202.6856   319.26820
##       395.56040   814.2446   813.0571  1488.5210  1249.3943   756.16593
##       239.39943   493.7437   493.4132   901.1463   455.9734   276.25939
##       497.79349  1037.7571   385.9460   827.4367   357.9240   217.11001
##         0.00000  1401.5062   420.4909  1640.0428   440.3812   179.44887
##      1410.31820     0.0000   754.5908  2330.3908   625.7323   370.46551
##       411.23787   774.3873     0.0000  4443.1293  1180.8505   429.50050
##      1630.31117  2294.8309  4519.6548     0.0000  4698.9106  1701.21576
##       433.19358   622.8328  1187.5683  4647.0436     0.0000  1614.30281
##       179.26962   367.9211   433.1798  1687.8429  1618.6540     0.00000
##       189.32242   283.1772   333.2491  1297.2654  1239.7476  1959.15156
##       199.93360   281.4470   456.9622  1781.8590  1714.8805   619.59245
##       471.58620   663.8309   882.2343  3448.6898  1141.3475   416.53708
##      1360.24725  1914.4657  1379.7695  5410.0349  1442.2143   525.02302
##       976.05441  1373.8464   991.7493  3876.2036  1037.7714   378.38543
##       366.02463   351.0034   177.4524   693.0426   185.7418    67.75517
##       401.51760   565.1785   408.3361  1593.4434   480.0823   175.53275
##      1024.37012   991.4735   503.4874  1961.9598   527.5240   396.79222
##       262.18101   254.7015   274.8289  1070.8774   420.8191   458.78853
##       688.74153   668.7592   766.3378  2988.5825  1031.4292   783.40088
##       269.72851   262.2294   302.6419  1178.3958  1127.0652   745.82157
##       131.80662   128.1539   138.2343   538.1075   454.6565   496.60461
## Sum 12100.00000 16700.0000 16300.0000 45100.0000 22400.0000 14000.00000
##                                                                          
##       717.0495   236.18043   162.74522   385.40505   276.45600   69.54798
##       123.2141    61.70049   103.14465   300.38819   215.23717   54.20438
##       239.7312    78.63850    54.11983    84.74064    60.77875   15.29175
##       570.6145   483.16807   331.92915   542.68441   388.95678   97.92709
##       208.7042   176.68622   175.42768   328.21009   235.10150   59.22417
##       164.2502   139.01663   232.56620   680.64827   486.63971  122.81188
##       205.8302   190.69403   460.54983  1352.64747   965.40421  360.01437
##       280.4119   270.95194   654.39555  1922.16108  1371.80643  346.79812
##       324.9553   457.58905   855.90294  1341.18960   959.11818  170.33061
##      1285.8136  1813.93194  3401.20208  5347.43878  3811.08391  676.33506
##      1215.8725  1727.19335  1177.25125  1409.93794  1009.40459  179.30849
##      1926.3401   625.73582   429.79490   514.76448   369.10661   65.59381
##         0.0000   710.35402   674.92838   396.10557   423.01528   78.28772
##       687.9491     0.00000  1280.92127   649.62410   797.29799   82.70895
##       675.5594  1250.21590     0.00000  1538.25238  1894.50118  195.33589
##       397.3168   623.28345  1510.97326     0.00000  3209.20409  567.57156
##       418.1537   768.78545  1870.01682  3225.97721     0.00000  405.58876
##        86.7449    80.38129   194.34904   574.56452   408.57459    0.00000
##       284.4672   524.08415  1283.22762  1316.54952  1633.99857  166.55587
##       643.3928   560.74566  1360.04804  1613.69888  1723.29458  426.40034
##       746.1859   459.09805   942.90587   478.20956   586.91494  108.58587
##      1272.2727  1125.99180  2646.52955  1334.18309  1638.85289  285.41214
##      1214.1266  1238.05385  1025.55682   522.24312   640.50586  111.62376
##       811.0435   497.51992   471.51404   240.37606   294.74621   54.54142
## Sum 14500.0000 14100.00000 21300.00000 26100.00000 23400.00000 4700.00000
##                                                                           
##       113.49491   204.52344   170.08579   293.46680   280.65706  186.45879
##        88.28937   159.12376    43.91609   107.64055    48.35516   32.10431
##        24.94960    45.86182    56.62463    97.64874    93.47544   62.15366
##       159.58052   287.60213   135.32500   291.38706   314.17023  148.36092
##        96.41691   173.77810    54.77862   153.96177   114.98880   54.30803
##       199.32982   359.33420    98.93324   242.55975    95.20233   50.60547
##       395.04469  1039.82917   284.79687   698.61818   273.70767  145.49886
##       561.33045  1012.07146   278.23868   682.28141   267.63861  142.26759
##       392.91254   499.58182   266.52646   749.75082   297.80838  136.26854
##      1558.38911  1978.93778  1055.51844  2972.06935  1178.65079  539.16245
##       498.83430   526.44257   409.87319  1031.21723  1115.29548  450.08181
##       182.47513   364.06259   450.47453   776.17748   744.18172  495.59677
##       286.35146   600.10759   744.72898  1281.58475  1231.73914  822.73389
##       540.78820   567.75473   443.85200  1117.69367  1216.01526  488.87139
##      1292.52229  1344.58291   941.89619  2668.44298  1034.73867  479.03748
##      1302.16920  1647.37795   469.59352  1321.73350   517.70196  239.95868
##      1622.44698  1681.88772   579.21364  1631.72086   638.17458  295.73340
##       166.90758   440.83212   120.19517   294.95067   115.42067   61.35784
##         0.00000  1151.06968   394.84830  1113.93203   434.66420  201.36361
##      1173.03729     0.00000   895.78128  2201.49259   857.67333  455.98853
##       398.08840   836.25060     0.00000  1815.21809   797.46141  533.92364
##      1112.91116  2202.65055  1795.93559     0.00000  1959.20528  905.48373
##       434.04481   857.47426   784.20255  1957.76947     0.00000  872.68063
##       199.68530   418.86304   524.66125   898.68226   873.07383    0.00000
## Sum 12800.00000 18400.00000 11000.00000 24400.00000 14500.00000 7800.00000
##        Sum
##       8800
##       4000
##       2800
##      11600
##       6100
##       7600
##      12100
##      16700
##      16200
##      45200
##      22300
##      13900
##      14600
##      14100
##      21400
##      26100
##      23400
##       4800
##      12800
##      18500
##      11000
##      24400
##      14500
##       7700
## Sum 360600
## RMSE: 6.67032e-09 
## Converged in 11 Iterations
## 
## attr(,"class")
## [1] "highway.assignment.class"
## 
## 
## $ff.vol
##    All
## 1    0
## 2    0
## 3    0
## 4    0
## 5    0
## 6    0
## 7    0
## 8    0
## 9    0
## 10   0
## 11   0
## 12   0
## 13   0
## 14   0
## 15   0
## 16   0
## 17   0
## 18   0
## 19   0
## 20   0
## 21   0
## 22   0
## 23   0
## 24   0
## 25   0
## 26   0
## 27   0
## 28   0
## 29   0
## 30   0
## 31   0
## 32   0
## 33   0
## 34   0
## 35   0
## 36   0
## 37   0
## 38   0
## 39   0
## 40   0
## 41   0
## 42   0
## 43   0
## 44   0
## 45   0
## 46   0
## 47   0
## 48   0
## 49   0
## 50   0
## 51   0
## 52   0
## 53   0
## 54   0
## 55   0
## 56   0
## 57   0
## 58   0
## 59   0
## 60   0
## 61   0
## 62   0
## 63   0
## 64   0
## 65   0
## 66   0
## 67   0
## 68   0
## 69   0
## 70   0
## 71   0
## 72   0
## 73   0
## 74   0
## 75   0
## 76   0
## 
## $ff.cost
##    cost.function(cost.volume(volume), aset)
## 1                                     5.973
## 2                                     4.199
## 3                                     6.181
## 4                                     4.941
## 5                                     4.131
## 6                                     4.000
## 7                                     3.932
## 8                                     3.930
## 9                                     2.142
## 10                                    6.140
## 11                                    1.891
## 12                                    3.912
## 13                                    5.029
## 14                                    4.997
## 15                                    3.848
## 16                                    1.866
## 17                                    3.048
## 18                                    1.928
## 19                                    2.153
## 20                                    2.969
## 21                                    9.929
## 22                                    4.835
## 23                                    4.812
## 24                                    9.818
## 25                                    3.095
## 26                                    2.949
## 27                                    4.984
## 28                                    6.024
## 29                                    3.926
## 30                                    7.931
## 31                                    6.154
## 32                                    5.190
## 33                                    5.814
## 34                                    4.133
## 35                                    4.167
## 36                                    5.866
## 37                                    3.088
## 38                                    3.042
## 39                                    4.108
## 40                                    4.152
## 41                                    4.939
## 42                                    3.988
## 43                                    6.026
## 44                                    5.160
## 45                                    2.846
## 46                                    3.107
## 47                                    5.128
## 48                                    4.015
## 49                                    2.163
## 50                                    2.863
## 51                                    7.913
## 52                                    2.152
## 53                                    2.139
## 54                                    2.197
## 55                                    2.946
## 56                                    3.845
## 57                                    2.800
## 58                                    1.891
## 59                                    3.928
## 60                                    3.871
## 61                                    3.899
## 62                                    5.882
## 63                                    4.912
## 64                                    6.188
## 65                                    1.861
## 66                                    2.954
## 67                                    3.088
## 68                                    4.808
## 69                                    2.072
## 70                                    4.079
## 71                                    3.853
## 72                                    4.144
## 73                                    2.047
## 74                                    3.933
## 75                                    3.186
## 76                                    1.950
## 
## $objective.function
## function (volume) 
## cost.integrator(cf, ff.vol, ff.cost, volume, cf(volume), tol, 
##     max.depth)
## <bytecode: 0x564acbf86aa8>
## <environment: 0x564acbf86178>
## 
## attr(,"class")
## [1] "highway.assignment.set"

1.1.9 Distribuição

#method = c("AON", "MSA", "Frank.Wolfe", "ParTan" )
assignment.results <- highway.assign(aset,method="Frank.Wolfe")
## Frank-Wolfe highway assignment
assignment.results
## $aset
## $network
## Highway Network:
##   Nodes: 24 Links: 76 Zones: 24 
##   First Through Node: 1 
## 
## $penalties
## [1] -1
## 
## $cost.function
## function (volume, aset) 
## {
##     as.data.frame(cost.function(cost.volume(volume), aset))
## }
## <bytecode: 0x564acbf4e6f0>
## <environment: 0x564acbf4cfc0>
## 
## $classes
## $classes$All
## $name
## [1] "All"
## 
## $network.set
## $edges
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## A       0    0    1    1    2    2    2    3    3     3     4     4     4     5
## B       1    2    0    5    0    3   11    2    4    10     3     5     8     1
## Link    0    1    2    3    4    5    6    7    8     9    10    11    12    13
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26]
## A        5     5     6     6     7     7     7     7     8     8     8     9
## B        4     7     7    17     5     6     8    15     4     7     9     8
## Link    14    15    16    17    18    19    20    21    22    23    24    25
##      [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38]
## A        9     9     9     9    10    10    10    10    11    11    11    12
## B       10    14    15    16     3     9    11    13     2    10    12    11
## Link    26    27    28    29    30    31    32    33    34    35    36    37
##      [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50]
## A       12    13    13    13    14    14    14    14    15    15    15    15
## B       23    10    14    22     9    13    18    21     7     9    16    17
## Link    38    39    40    41    42    43    44    45    46    47    48    49
##      [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [,61] [,62]
## A       16    16    16    17    17    17    18    18    18    19    19    19
## B        9    15    18     6    15    19    14    16    19    17    18    20
## Link    50    51    52    53    54    55    56    57    58    59    60    61
##      [,63] [,64] [,65] [,66] [,67] [,68] [,69] [,70] [,71] [,72] [,73] [,74]
## A       19    20    20    20    21    21    21    21    22    22    22    23
## B       21    19    21    23    14    19    20    22    13    21    23    12
## Link    62    63    64    65    66    67    68    69    70    71    72    73
##      [,75] [,76]
## A       23    23
## B       20    22
## Link    74    75
## attr(,"numNodes")
## [1] 24
## attr(,"numZones")
## [1] 24
## attr(,"numLinks")
## [1] 76
## attr(,"firstThruNode")
## [1] 0
## 
## $turns
##        [,1]
## Node     -1
## Parent   -1
## Child    -1
## Turn     -1
## 
## $offsets
##         [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
## NODE       0    1    2    3    4    5    6    7    8     9    10    11    12
## Start      0    2    4    7   10   13   16   18   22    25    30    34    37
## End        2    4    7   10   13   16   18   22   25    30    34    37    39
## TurnOn     0    0    0    0    0    0    0    0    0     0     0     0     0
## TurnOff    0    0    0    0    0    0    0    0    0     0     0     0     0
##         [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## NODE       13    14    15    16    17    18    19    20    21    22    23
## Start      39    42    46    50    53    56    59    63    66    70    73
## End        42    46    50    53    56    59    63    66    70    73    76
## TurnOn      0     0     0     0     0     0     0     0     0     0     0
## TurnOff     0     0     0     0     0     0     0     0     0     0     0
## 
## attr(,"class")
## [1] "highway.network.set"
## 
## $demand
##                                                                       
##        0.00000  507.55977  324.83890   767.30831  276.09426  336.39498
##      481.47700    0.00000   55.30066   208.56643  124.30146  264.18079
##      332.87530   59.71046    0.00000   257.81426   92.40287   74.01197
##      788.77789  206.58493  258.71759     0.00000  601.06520  476.20531
##      288.20157  125.01952   94.18590   611.60733    0.00000  289.46418
##      314.05180  259.88251   73.76149   473.23977  283.19948    0.00000
##      259.27245  213.13486   60.83656   388.64327  231.60007  492.00720
##      535.56929  441.58007  125.72679   804.74550  480.37127 1030.15629
##      412.18597  178.66908  134.14530   859.61475  513.71462  410.63053
##      769.58817  353.38207  250.14755  1599.13025  953.49194  810.80346
##      611.22807  158.43971  198.99533  1259.68453  452.65892  363.33955
##      958.21796  173.09810  314.10771   741.90447  266.94907  214.55135
##      735.46078  133.17476  239.95266   569.38485  205.11172  165.06520
##      235.92023   61.20521   76.66969   483.71013  174.20014  140.14317
##      159.13724  102.45939   51.65231   324.53323  188.13598  234.77069
##      357.01722  293.09840   83.75267   534.57728  318.35581  674.56001
##      257.43384  211.12757   60.38023   385.13779  229.25118  484.95975
##       65.47779   53.75153   15.36026    98.03757   58.38237  123.69208
##      106.20778   87.04192   24.90738   158.79946   94.49492  199.69713
##      186.30341  152.68664   49.21338   278.56099  165.76134  350.31389
##      174.68553   39.37777   56.77022   135.22751   58.76258   90.13762
##      298.77171  103.32836   97.03918   293.84077  163.72730  236.61311
##      283.72042   51.50562   92.23348   320.06898  115.37812   92.92921
##      188.41857   34.18175   61.30476   145.86262   52.58941   45.37254
## Sum 8800.00000 4000.00000 2800.00000 11700.00000 6100.00000 7600.00000
##                                                                        
##       280.66070   576.4649   379.5857   697.3755   607.6058   950.04033
##       219.02404   451.2453   170.7029   366.4369   158.6090   162.83741
##        61.71758   126.7995   126.5274   232.1724   202.6856   319.26820
##       395.56040   814.2446   813.0571  1488.5210  1249.3943   756.16593
##       239.39943   493.7437   493.4132   901.1463   455.9734   276.25939
##       497.79349  1037.7571   385.9460   827.4367   357.9240   217.11001
##         0.00000  1401.5062   420.4909  1640.0428   440.3812   179.44887
##      1410.31820     0.0000   754.5908  2330.3908   625.7323   370.46551
##       411.23787   774.3873     0.0000  4443.1293  1180.8505   429.50050
##      1630.31117  2294.8309  4519.6548     0.0000  4698.9106  1701.21576
##       433.19358   622.8328  1187.5683  4647.0436     0.0000  1614.30281
##       179.26962   367.9211   433.1798  1687.8429  1618.6540     0.00000
##       189.32242   283.1772   333.2491  1297.2654  1239.7476  1959.15156
##       199.93360   281.4470   456.9622  1781.8590  1714.8805   619.59245
##       471.58620   663.8309   882.2343  3448.6898  1141.3475   416.53708
##      1360.24725  1914.4657  1379.7695  5410.0349  1442.2143   525.02302
##       976.05441  1373.8464   991.7493  3876.2036  1037.7714   378.38543
##       366.02463   351.0034   177.4524   693.0426   185.7418    67.75517
##       401.51760   565.1785   408.3361  1593.4434   480.0823   175.53275
##      1024.37012   991.4735   503.4874  1961.9598   527.5240   396.79222
##       262.18101   254.7015   274.8289  1070.8774   420.8191   458.78853
##       688.74153   668.7592   766.3378  2988.5825  1031.4292   783.40088
##       269.72851   262.2294   302.6419  1178.3958  1127.0652   745.82157
##       131.80662   128.1539   138.2343   538.1075   454.6565   496.60461
## Sum 12100.00000 16700.0000 16300.0000 45100.0000 22400.0000 14000.00000
##                                                                          
##       717.0495   236.18043   162.74522   385.40505   276.45600   69.54798
##       123.2141    61.70049   103.14465   300.38819   215.23717   54.20438
##       239.7312    78.63850    54.11983    84.74064    60.77875   15.29175
##       570.6145   483.16807   331.92915   542.68441   388.95678   97.92709
##       208.7042   176.68622   175.42768   328.21009   235.10150   59.22417
##       164.2502   139.01663   232.56620   680.64827   486.63971  122.81188
##       205.8302   190.69403   460.54983  1352.64747   965.40421  360.01437
##       280.4119   270.95194   654.39555  1922.16108  1371.80643  346.79812
##       324.9553   457.58905   855.90294  1341.18960   959.11818  170.33061
##      1285.8136  1813.93194  3401.20208  5347.43878  3811.08391  676.33506
##      1215.8725  1727.19335  1177.25125  1409.93794  1009.40459  179.30849
##      1926.3401   625.73582   429.79490   514.76448   369.10661   65.59381
##         0.0000   710.35402   674.92838   396.10557   423.01528   78.28772
##       687.9491     0.00000  1280.92127   649.62410   797.29799   82.70895
##       675.5594  1250.21590     0.00000  1538.25238  1894.50118  195.33589
##       397.3168   623.28345  1510.97326     0.00000  3209.20409  567.57156
##       418.1537   768.78545  1870.01682  3225.97721     0.00000  405.58876
##        86.7449    80.38129   194.34904   574.56452   408.57459    0.00000
##       284.4672   524.08415  1283.22762  1316.54952  1633.99857  166.55587
##       643.3928   560.74566  1360.04804  1613.69888  1723.29458  426.40034
##       746.1859   459.09805   942.90587   478.20956   586.91494  108.58587
##      1272.2727  1125.99180  2646.52955  1334.18309  1638.85289  285.41214
##      1214.1266  1238.05385  1025.55682   522.24312   640.50586  111.62376
##       811.0435   497.51992   471.51404   240.37606   294.74621   54.54142
## Sum 14500.0000 14100.00000 21300.00000 26100.00000 23400.00000 4700.00000
##                                                                           
##       113.49491   204.52344   170.08579   293.46680   280.65706  186.45879
##        88.28937   159.12376    43.91609   107.64055    48.35516   32.10431
##        24.94960    45.86182    56.62463    97.64874    93.47544   62.15366
##       159.58052   287.60213   135.32500   291.38706   314.17023  148.36092
##        96.41691   173.77810    54.77862   153.96177   114.98880   54.30803
##       199.32982   359.33420    98.93324   242.55975    95.20233   50.60547
##       395.04469  1039.82917   284.79687   698.61818   273.70767  145.49886
##       561.33045  1012.07146   278.23868   682.28141   267.63861  142.26759
##       392.91254   499.58182   266.52646   749.75082   297.80838  136.26854
##      1558.38911  1978.93778  1055.51844  2972.06935  1178.65079  539.16245
##       498.83430   526.44257   409.87319  1031.21723  1115.29548  450.08181
##       182.47513   364.06259   450.47453   776.17748   744.18172  495.59677
##       286.35146   600.10759   744.72898  1281.58475  1231.73914  822.73389
##       540.78820   567.75473   443.85200  1117.69367  1216.01526  488.87139
##      1292.52229  1344.58291   941.89619  2668.44298  1034.73867  479.03748
##      1302.16920  1647.37795   469.59352  1321.73350   517.70196  239.95868
##      1622.44698  1681.88772   579.21364  1631.72086   638.17458  295.73340
##       166.90758   440.83212   120.19517   294.95067   115.42067   61.35784
##         0.00000  1151.06968   394.84830  1113.93203   434.66420  201.36361
##      1173.03729     0.00000   895.78128  2201.49259   857.67333  455.98853
##       398.08840   836.25060     0.00000  1815.21809   797.46141  533.92364
##      1112.91116  2202.65055  1795.93559     0.00000  1959.20528  905.48373
##       434.04481   857.47426   784.20255  1957.76947     0.00000  872.68063
##       199.68530   418.86304   524.66125   898.68226   873.07383    0.00000
## Sum 12800.00000 18400.00000 11000.00000 24400.00000 14500.00000 7800.00000
##        Sum
##       8800
##       4000
##       2800
##      11600
##       6100
##       7600
##      12100
##      16700
##      16200
##      45200
##      22300
##      13900
##      14600
##      14100
##      21400
##      26100
##      23400
##       4800
##      12800
##      18500
##      11000
##      24400
##      14500
##       7700
## Sum 360600
## RMSE: 6.67032e-09 
## Converged in 11 Iterations
## 
## attr(,"class")
## [1] "highway.assignment.class"
## 
## 
## $ff.vol
##    All
## 1    0
## 2    0
## 3    0
## 4    0
## 5    0
## 6    0
## 7    0
## 8    0
## 9    0
## 10   0
## 11   0
## 12   0
## 13   0
## 14   0
## 15   0
## 16   0
## 17   0
## 18   0
## 19   0
## 20   0
## 21   0
## 22   0
## 23   0
## 24   0
## 25   0
## 26   0
## 27   0
## 28   0
## 29   0
## 30   0
## 31   0
## 32   0
## 33   0
## 34   0
## 35   0
## 36   0
## 37   0
## 38   0
## 39   0
## 40   0
## 41   0
## 42   0
## 43   0
## 44   0
## 45   0
## 46   0
## 47   0
## 48   0
## 49   0
## 50   0
## 51   0
## 52   0
## 53   0
## 54   0
## 55   0
## 56   0
## 57   0
## 58   0
## 59   0
## 60   0
## 61   0
## 62   0
## 63   0
## 64   0
## 65   0
## 66   0
## 67   0
## 68   0
## 69   0
## 70   0
## 71   0
## 72   0
## 73   0
## 74   0
## 75   0
## 76   0
## 
## $ff.cost
##    cost.function(cost.volume(volume), aset)
## 1                                     5.973
## 2                                     4.199
## 3                                     6.181
## 4                                     4.941
## 5                                     4.131
## 6                                     4.000
## 7                                     3.932
## 8                                     3.930
## 9                                     2.142
## 10                                    6.140
## 11                                    1.891
## 12                                    3.912
## 13                                    5.029
## 14                                    4.997
## 15                                    3.848
## 16                                    1.866
## 17                                    3.048
## 18                                    1.928
## 19                                    2.153
## 20                                    2.969
## 21                                    9.929
## 22                                    4.835
## 23                                    4.812
## 24                                    9.818
## 25                                    3.095
## 26                                    2.949
## 27                                    4.984
## 28                                    6.024
## 29                                    3.926
## 30                                    7.931
## 31                                    6.154
## 32                                    5.190
## 33                                    5.814
## 34                                    4.133
## 35                                    4.167
## 36                                    5.866
## 37                                    3.088
## 38                                    3.042
## 39                                    4.108
## 40                                    4.152
## 41                                    4.939
## 42                                    3.988
## 43                                    6.026
## 44                                    5.160
## 45                                    2.846
## 46                                    3.107
## 47                                    5.128
## 48                                    4.015
## 49                                    2.163
## 50                                    2.863
## 51                                    7.913
## 52                                    2.152
## 53                                    2.139
## 54                                    2.197
## 55                                    2.946
## 56                                    3.845
## 57                                    2.800
## 58                                    1.891
## 59                                    3.928
## 60                                    3.871
## 61                                    3.899
## 62                                    5.882
## 63                                    4.912
## 64                                    6.188
## 65                                    1.861
## 66                                    2.954
## 67                                    3.088
## 68                                    4.808
## 69                                    2.072
## 70                                    4.079
## 71                                    3.853
## 72                                    4.144
## 73                                    2.047
## 74                                    3.933
## 75                                    3.186
## 76                                    1.950
## 
## $objective.function
## function (volume) 
## cost.integrator(cf, ff.vol, ff.cost, volume, cf(volume), tol, 
##     max.depth)
## <bytecode: 0x564acbf86aa8>
## <environment: 0x564acbf86178>
## 
## attr(,"class")
## [1] "highway.assignment.set"
## 
## $costs
##    cost.function(cost.volume(volume), aset)
## 1                                     5.973
## 2                                     4.199
## 3                                     6.181
## 4                                     4.941
## 5                                     4.131
## 6                                     4.000
## 7                                     3.932
## 8                                     3.930
## 9                                     2.142
## 10                                    6.140
## 11                                    1.891
## 12                                    3.912
## 13                                    5.029
## 14                                    4.997
## 15                                    3.848
## 16                                    1.866
## 17                                    3.048
## 18                                    1.928
## 19                                    2.153
## 20                                    2.969
## 21                                    9.929
## 22                                    4.835
## 23                                    4.812
## 24                                    9.818
## 25                                    3.095
## 26                                    2.949
## 27                                    4.984
## 28                                    6.024
## 29                                    3.926
## 30                                    7.931
## 31                                    6.154
## 32                                    5.190
## 33                                    5.814
## 34                                    4.133
## 35                                    4.167
## 36                                    5.866
## 37                                    3.088
## 38                                    3.042
## 39                                    4.108
## 40                                    4.152
## 41                                    4.939
## 42                                    3.988
## 43                                    6.026
## 44                                    5.160
## 45                                    2.846
## 46                                    3.107
## 47                                    5.128
## 48                                    4.015
## 49                                    2.163
## 50                                    2.863
## 51                                    7.913
## 52                                    2.152
## 53                                    2.139
## 54                                    2.197
## 55                                    2.946
## 56                                    3.845
## 57                                    2.800
## 58                                    1.891
## 59                                    3.928
## 60                                    3.871
## 61                                    3.899
## 62                                    5.882
## 63                                    4.912
## 64                                    6.188
## 65                                    1.861
## 66                                    2.954
## 67                                    3.088
## 68                                    4.808
## 69                                    2.072
## 70                                    4.079
## 71                                    3.853
## 72                                    4.144
## 73                                    2.047
## 74                                    3.933
## 75                                    3.186
## 76                                    1.950
## 
## $paths
## $paths$All
## , , 1
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    0    0    0    2    3    1    7    5    4     8    11     2    11    10
## [2,]   -1    0    1    5    8    3   19   15   12    24    35     6    36    33
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    13     7    15     6    16    17    23    20    23    12
## [2,]    40    21    48    17    52    55    74    64    75    38
## 
## , , 2
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    1    1    0    4    5    1    7    5    4    15     3     2    11    10
## [2,]    2   -1    1   10   14    3   19   15   12    47     9     6    36    33
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    18     7    15     6    16    17    19    19    23    12
## [2,]    56    21    48    17    52    55    61    62    75    38
## 
## , , 3
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    2    0    2    2    3    4    7    5    4     8    11     2    11    10
## [2,]    4    0   -1    5    8   11   19   15   12    24    35     6    36    33
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    13     7    15     6    16    20    23    20    23    12
## [2,]    40    21    48    17    52    63    74    64    75    38
## 
## , , 4
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    2    5    3    3    3    4    7    5    4     8     3     2    11    10
## [2,]    4   13    7   -1    8   11   19   15   12    24     9     6    36    33
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    13     7    15     6    16    17    23    14    13    12
## [2,]    40    21    48    17    52    55    74    45    41    38
## 
## , , 5
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    2    5    3    4    4    4    7    5    4     8     3     2    11    10
## [2,]    4   13    7   10   -1   11   19   15   12    24     9     6    36    33
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]     9     7    15     6    16    17    21    14    13    12
## [2,]    27    21    48    17    52    55    68    45    41    38
## 
## , , 6
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    1    5    3    4    5    5    7    5    4    15     3     2    11    10
## [2,]    2   13    7   10   14   -1   19   15   12    47     9     6    36    33
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    18     7    15     6    16    17    19    19    21    20
## [2,]    56    21    48    17    52    55    61    62    69    65
## 
## , , 7
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    1    5    3    4    5    7    6    6    9    15     9     2    23    14
## [2,]    2   13    7   10   14   18   -1   16   25    47    26     6    73    43
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    18    17    15     6    16    17    19    19    21    20
## [2,]    56    54    48    17    52    55    61    62    69    65
## 
## , , 8
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    1    5    3    4    5    7    7    7    7    15     9     2    11    14
## [2,]    2   13    7   10   14   18   19   -1   20    47    26     6    36    43
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    18     7    15     6    16    17    19    19    21    20
## [2,]    56    21    48    17    52    55    61    62    69    65
## 
## , , 9
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    2    5    3    4    8    4   17    8    8     8     9    10    11    10
## [2,]    4   13    7   10   22   11   53   23   -1    24    26    32    36    33
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]     9     9    15    15    16    17    21    14    13    20
## [2,]    27    28    48    49    52    55    68    45    41    65
## 
## , , 10
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    2    5    3    4    8    7   17   15    9     9     9    10    11    10
## [2,]    4   13    7   10   22   18   53   46   25    -1    26    32    36    33
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]     9     9    15    15    16    17    21    14    13    20
## [2,]    27    28    48    49    52    55    68    45    41    65
## 
## , , 11
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    2    5   11   10    3    4   17    5    9    10    10    10    11    10
## [2,]    4   13   34   30    8   11   53   15   25    31    -1    32    36    33
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    13     9    15    15    14    17    23    14    13    22
## [2,]    40    28    48    49    44    55    74    45    41    72
## 
## , , 12
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    2    0   11    2    3    4    7    5    9    10    11    11    11    10
## [2,]    4    0   34    5    8   11   19   15   25    31    35    -1    36    33
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    13     9    15    15    14    20    23    20    23    12
## [2,]    40    28    48    49    44    63    74    64    75    38
## 
## , , 13
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    2    0   11    2    3    4   17    5    9    10    11    12    12    22
## [2,]    4    0   34    5    8   11   53   15   25    31    35    37    -1    70
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    21     9    18    19    14    20    23    20    23    12
## [2,]    66    28    57    59    44    63    74    64    75    38
## 
## , , 14
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    2    5   11   10    3    4   17   15    9    10    13    10    23    13
## [2,]    4   13   34   30    8   11   53   46   25    31    39    32    73    -1
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    13    16    18    15    14    18    23    14    13    22
## [2,]    40    51    57    49    44    58    74    45    41    72
## 
## , , 15
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    2    5   11   10    8    7   17   15    9    14    13    12    23    14
## [2,]    4   13   34   30   22   18   53   46   25    42    39    37    73    43
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    14    16    18    15    14    18    21    14    21    20
## [2,]    -1    51    57    49    44    58    68    45    69    65
## 
## , , 16
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    1    5    3    4    5    7   17   15    9    15     9    10    11    14
## [2,]    2   13    7   10   14   18   53   46   25    47    26    32    36    43
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    18    15    15    15    16    17    21    14    21    20
## [2,]    56    -1    48    49    52    55    68    45    69    65
## 
## , , 17
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    1    5    3    4    5    7   17   15    9    15     9    10    23    14
## [2,]    2   13    7   10   14   18   53   46   25    47    26    32    73    43
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    18    16    16    15    16    18    21    14    21    20
## [2,]    56    51    -1    49    52    58    68    45    69    65
## 
## , , 18
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    1    5    3    4    5    7   17    6    9    15     9    10    23    14
## [2,]    2   13    7   10   14   18   53   16   25    47    26    32    73    43
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    18    17    15    17    16    17    19    19    21    20
## [2,]    56    54    48    -1    52    55    61    62    69    65
## 
## , , 19
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    1    5    3    4    5    7   17   15    9    15    13    12    23    14
## [2,]    2   13    7   10   14   18   53   46   25    47    39    37    73    43
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    18    16    18    15    18    18    21    14    21    20
## [2,]    56    51    57    49    -1    58    68    45    69    65
## 
## , , 20
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    1    5   11    4    5    7   17    6    9    15     9    12    23    14
## [2,]    2   13   34   10   14   18   53   16   25    47    26    37    73    43
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    18    17    18    19    19    19    19    19    21    20
## [2,]    56    54    57    59    60    -1    61    62    69    65
## 
## , , 21
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    2    5   11    2    8    7   17    6    9    14    13    12    23    22
## [2,]    4   13   34    5   22   18   53   16   25    42    39    37    73    70
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    21    16    18    19    14    20    20    20    23    20
## [2,]    66    51    57    59    44    63    -1    64    75    65
## 
## , , 22
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    2    5   11   10    8    7   17    6    9    14    13    12    23    22
## [2,]    4   13   34   30   22   18   53   16   25    42    39    37    73    70
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    21    16    18    19    14    21    21    21    21    20
## [2,]    66    51    57    59    44    67    68    -1    69    65
## 
## , , 23
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    2    0   11   10    3    4   17    6    9    10    13    12    23    22
## [2,]    4    0   34   30    8   11   53   16   25    31    39    37    73    70
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    21    16    18    19    14    21    23    22    22    22
## [2,]    66    51    57    59    44    67    74    71    -1    72
## 
## , , 24
## 
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,]    2    0   11    2    3    7   17    6    9    14    13    12    23    22
## [2,]    4    0   34    5    8   18   53   16   25    42    39    37    73    70
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]    21    16    18    19    14    20    23    20    23    23
## [2,]    66    51    57    59    44    63    74    64    75    -1
## 
## attr(,"numNodes")
## [1] 24
## attr(,"numLinks")
## [1] 76
## attr(,"numZones")
## [1] 24
## attr(,"firstThruNode")
## [1] 0
## 
## 
## $volumes
##           All
## 1   3202.1784
## 2   6471.3040
## 3   2984.6223
## 4   5339.6593
## 5   6688.8601
## 6   6604.5845
## 7   8582.4326
## 8   6802.0997
## 9  12440.1988
## 10  4134.9473
## 11 12009.6967
## 12  9096.1673
## 13  6072.6154
## 14  5122.1031
## 15  8246.3366
## 16 15086.7298
## 17  7945.9277
## 18 13845.0727
## 19 14019.3430
## 20  8255.2656
## 21   754.5908
## 22 13933.6607
## 23  6491.9440
## 24   774.3873
## 25 16620.0357
## 26 17159.1608
## 27 18997.0718
## 28 10360.5691
## 29 27139.7405
## 30     0.0000
## 31  4862.9645
## 32 18209.8657
## 33  9682.5467
## 34 13840.4632
## 35  8602.4736
## 36 10535.4904
## 37 11989.6531
## 38 12962.6377
## 39 11578.5329
## 40 13028.3307
## 41  9677.9235
## 42  6717.5564
## 43 10518.5184
## 44  6215.1050
## 45 20128.8339
## 46 23512.1277
## 47 13155.8153
## 48 28208.1225
## 49 25695.9641
## 50 13045.7508
## 51     0.0000
## 52 26011.5573
## 53 21435.2248
## 54 13535.7347
## 55 13020.6942
## 56 12625.8393
## 57 19885.0713
## 58 21750.8180
## 59  4745.2950
## 60 12191.4447
## 61  4817.1256
## 62  3959.5531
## 63  5837.1857
## 64  3647.6141
## 65 12240.3243
## 66 13450.1838
## 67 20351.0211
## 68  5686.5608
## 69 12987.8429
## 70  8645.3891
## 71  9368.2425
## 72  6081.1760
## 73  6524.9184
## 74 12451.5175
## 75 12390.7262
## 76  6611.3914
## 
## $iset
## NULL
## 
## $intercept
## NULL
## 
## $results
## $results$iter
## [1] 1
## 
## $results$elapsed
## [1] 0.558
## 
## $results$objective
## [1] 2970021
## 
## $results$gap
## [1] 0
## 
## $results$relative.gap
## [1] 0
## 
## $results$lower.bound
## [1] 2970021
## 
## $results$best.lower.bound
## [1] 2970021
## 
## $results$avg.excess.cost
## [1] 0
## 
## $results$lambda
## [1] 1
## 
## 
## $log
## [1] FALSE
## 
## $method
## [1] ".highway.assignment.Frank.Wolfe"
loaded.links <- assignment.results$volumes
loaded.links

2 Documentação

Details

The highway.assign function performs a traffic assignment using the network and demand data specified in its first argument, which is an assignment.set. The assignment method is chosen using the method argument, which may refer to user-defined methods as described below. The control argument is a list of values that set values for convergence criteria and adjust the behavior of the algorithm in various ways. Valid control elements for the built-in algorithms are described below.

Most of the highway assignment algorithms reflect descriptions provided in Sheffi (1985). ParTan is described in Lee and Nie, 2001.

Overview of Built-In Algorithms

The method specifies the algorithm to be used for the traffic assignment. Four common assignment algorithms are built in:

AON

“All-or-Nothing” assignment. The algorithm builds shortest paths fromthe free-flow speeds defined for the assignment set, and loads all the demand onto those paths without considering capacity limits. The steps are these:

    Build paths

    Load Traffic

    Stop

MSA

“Multiple Successive Averages” does a simple form of capacity restraint by averaging the volumes from successive AON assignments where the next assignment uses the costs from the average volumes from all the previous assignment volumes. The steps are these:

    Build paths using costs from average link volumes (initially free-flow)

    Load Traffic

    Compute the new average volume and the associated link costs

    If maximum number of iterations is reached, stop, otherwise return to step 1.

Frank.Wolfe

Computes an equilibrium assignment using the simple, low-resource, but slowly converging Frank-Wolfe algorithm. This is a widely used method in travel demand modeling, but it is gradually becomign obsolete due to advances in computing capacity and the desire to achieve faster convergence to a narrower tolerance. (The TravelR project exists in part to help explore practical implementations of alternative algorithms.) The steps are these:

    Build paths using costs from current equilibrium link volumes (initially free-flow)

    Load Traffic

    Compute the combination of equilibrium volume and shortest path volume that minimizes the objective function

    Update the equilibrium volume to the combined value

    Recompute link costs from equilibrium flow

    If convergence target is met, stop, otherwise return to step 1.

ParTan

The “Parallel-Tangent” algorithm extends the Frank-Wolfe approach by rectifying the search direction using a previous search direction. This algorithm converges somewhat faster than the basic Frank-Wolfe method. There is an additional line search for the second and subsequent iterations that finds the lowest cost combination of the previous equilibrium volumes and the current combined volume from a standard Frank-Wolfe step. The steps are these:

    Build paths using costs from current equilibrium link volumes (initially free-flow)

    Load Traffic

    Compute the combination of equilibrium volume and shortest path volume that minimizes the objective function

    Compute the combination of the new combined value and the equilibrium result at the start of the previous iteration that minimizes the objective function

    Save the current equilibrium volume for a later iteration

    Update the equlibrium volume with the final combined volume

    Recompute link costs from the new equilibrium flow

    If convergence target is met, stop, otherwise return to step 1.

Additional algorithms can be implemented in specially named functions provided by the user, through a mechanism similar to (but less sophisticated than) R’s S3 methods. The supplied method name is prefixed by “highway.assignment.” and a function by that name is sought in the calling environment of the function. The internal methods are named differently and are sought only when the search for user-defined functions fails. It is thus possible to supply an alternate implementation for one of the internal methods by providing a function with a suitable name (e.g. highway.assignment.Frank.Wolfe)

The function that implements an assignment algorithm will be passed the aset and control parameters, and should return a list of values, with elements comparable to those returned by the standard algorithms. An element called method will be concatenated to the list returned from the algorithm function.

Control Parameters

The control argument is a list of optional parameters that alter the behavior of the assignment algorithms in various ways. The sets of elements relevant to each built-in algorithm are described first, and a description of each follows.

All Methods

intercept (see below), log, verbose

AON

No additional parameters

MSA

max.iter

Frank.Wolfe

max.iter, min.relative.gap, max.elapsed, opt.tol

ParTan

max.iter, min.relative.gap, max.elapsed, opt.tol

intercept If this value is an intercept.set, then do select link processing (not set by default); see below verbose If greater than 0, add additional messages (higher numbers imply more, but all the functions are currently quite terse; default is 1 log If TRUE, return results of each iteration in a data.frame; defaults to FALSE max.iter Maximum number of iterations before stopping (defaults to 4 for MSA, and 100 for other algorithms min.relative.gap Equilibrium algorithms will stop if relative.gap statistic drops below this value (default 1e-4) max.elapsed Maximum allowable run-time in seconds (default 3600) opt.tol Tolerance for line search optimization (default .Machine$double.eps^0.5)

Select Link Processing

Travel modelers often seek information on which specific links are assigned demand for particular zone pairs. The select link results are reported either as a matrix of demand from origin to destination that passes through one of the selected links, or as a vector of volumes tha results when the selected demand matrix is assigned.

Internally, select link processing identifies links of interest, constructs a subset of the matrix of the demand matrix that only includes origins and destinations, and assigns that demand to the network. Currently, select link processing applies to all assignment classes, and the selected demand and link volumes for each class are maintained separately. Naturally, one is rarely interested in flows that follow a single path (say the shortest path). Consequently, within the assignment algorithms when an intercept is specified, the intercepts and demands are computed at each iteration, and the results are combined using the same factors used for the total equilibrium flow. Thus, the intercepts will include a portion of traffic due to rarely used alternate paths that may intercept a link of interest.

Needless to say, processing select link intercepts on a large network, or through many iterations, will be substantially slower than simply computing a total equilibrium assignment.

See intercept.set for details about setting up a select link analysis. Value

Returns a list with various elements. The possible elements are enumerated in the following table, which shows the element name and description. Certain elements are only returned if suitable control values are provided, and they are so indicated. aset the assignment set which was assigned (identical to the aset argument costs a data.frame with one column per assignment class and one row per link paths the shortest path tree for the final assignment iteration resulting from the final costs volumes a data.frame of volumes, with one column per assignment class and one row per link iset the control argument describing the intercept (only present if it was supplied) intercept A list of two elements: od a list of intercepted demand matrices, one for each class, and volumes a data frame with one column per class of intercepted volumes (only present if an intercept set was supplied in the control argument) results data.frame of one row with the assignment statistics from the final iteration log data.frame with assignment statistics from all iterations method the method selected either as an argument or by default Author(s)

Jeremy Raw References

Lee, D.-H., and Nie, Y. “Accelerating Strategies and Computational Studies of the Frank-Wolfe Algorithm for the Traffic Assignment Problem”, 2001, Transportation Resarch Record, 1771:97-105. Sheffi, Y., 1985, Urban Transportation Networks, Prentice-Hall; available online as a PDF at http://web.mit.edu/sheffi/www/urbanTransportation.html See Also