This function is the C++ implementation of run_model, it will run a singly constrained model there must be a match in the dimensions, when running a production constrained model, any(dim(distance) == length(flows)) must be TRUE if no values for weight are provided, a vector with ones is used
Arguments
- flows
A vector of either origin (production constrained) or destination (attraction constrained) flows.
- distance
a distance matrix between origins and destinations, provide distance in km.
- weight
a vector of weights for the unconstrained part of the model.
- beta
Exponent to use when calculating the cost function, default .25.