Created
October 27, 2019 22:10
-
-
Save msaroufim/794da1c039d02f4e02a8aedff925a44f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Full example here https://github.com/JuliaOpt/JuMP.jl/blob/master/examples/cannery.jl | |
@variable(cannery, ship[1:num_plants, 1:num_markets] >= 0) | |
# Ship no more than plant capacity | |
@constraint(cannery, capacity_con[i in 1:num_plants], | |
sum(ship[i,j] for j in 1:num_markets) <= capacity[i] | |
) | |
# Ship at least market demand | |
@constraint(cannery, demand_con[j in 1:num_markets], | |
sum(ship[i,j] for i in 1:num_plants) >= demand[j] | |
) | |
# Minimize transporatation cost | |
@objective(cannery, Min, sum(distance[i, j] * freight * ship[i, j] | |
for i in 1:num_plants, j in 1:num_markets) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment