Extract the cost matrix used to compute this model
Examples
positions <- matrix(rnorm(10 * 2), ncol = 2)
distances <- as.matrix(dist(positions))
production <- rep(1, 10)
attractiveness <- c(2, rep(1, 9))
model <- static_blvim(distances, production, 1.5, 1, attractiveness)
costs(model) ## should be equal to distances above
#> 1 2 3 4 5 6 7
#> 1 0.0000000 3.0962405 3.0078283 1.9865063 2.715466 3.6879614 0.9541694
#> 2 3.0962405 0.0000000 1.5815172 1.8122429 2.514123 1.7036951 2.5497113
#> 3 3.0078283 1.5815172 0.0000000 1.0327424 1.070578 0.6972269 2.1170403
#> 4 1.9865063 1.8122429 1.0327424 0.0000000 1.006080 1.7267010 1.0845204
#> 5 2.7154660 2.5141233 1.0705782 1.0060798 0.000000 1.6103162 1.7637408
#> 6 3.6879614 1.7036951 0.6972269 1.7267010 1.610316 0.0000000 2.8110675
#> 7 0.9541694 2.5497113 2.1170403 1.0845204 1.763741 2.8110675 0.0000000
#> 8 1.7185293 2.2427550 1.4214261 0.4579489 1.019305 2.1173425 0.7661321
#> 9 2.4508800 0.6544131 1.4155043 1.2785807 2.135256 1.7989721 1.9028600
#> 10 0.3478276 3.1186403 2.8526439 1.8200702 2.458067 3.5444020 0.7391181
#> 8 9 10
#> 1 1.7185293 2.4508800 0.3478276
#> 2 2.2427550 0.6544131 3.1186403
#> 3 1.4214261 1.4155043 2.8526439
#> 4 0.4579489 1.2785807 1.8200702
#> 5 1.0193047 2.1352562 2.4580673
#> 6 2.1173425 1.7989721 3.5444020
#> 7 0.7661321 1.9028600 0.7391181
#> 8 0.0000000 1.6688482 1.4948168
#> 9 1.6688482 0.0000000 2.4647705
#> 10 1.4948168 2.4647705 0.0000000
all.equal(costs(model), distances)
#> [1] TRUE