addDistance

fun addDistance(fromLoc: String, toLoc: String, distance: Double, symmetric: Boolean = false): Pair<LocationIfc, LocationIfc>

Adds the distance from location fromLoc to location toLoc where fromLoc and toLoc are string names of locations. If a location with the name does not already exist in the model, then a new location with the name is created. The flag symmetric will cause an additional distance to be added going from toLoc to location fromLoc that has the same distance. The default value of the flag is false. The pair must not have already been added to the model.

Return

the pair of locations added


fun addDistance(fromLocation: LocationIfc, toLocation: LocationIfc, distance: Double, symmetric: Boolean = false)

Adds a distance value between the pair of locations, going from fromLocation to toLocation. The distance must be greater than or equal to 0.0. The flag symmetric will cause an additional distance to be added going from toLocation to location fromLocation that has the same distance. The default value of the flag is false. The pair must not have already been added to the model. Use changeDistance() in that case.