Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
personal:blog:2017:0203_jump_for_gams_users [2017/02/03 15:32] antonello |
personal:blog:2017:0203_jump_for_gams_users [2018/06/18 15:11] 127.0.0.1 external edit |
||
---|---|---|---|
Line 35: | Line 35: | ||
Pkg.add(" | Pkg.add(" | ||
Pkg.add(" | Pkg.add(" | ||
- | Pkg.add(" | + | Pkg.add(" |
</ | </ | ||
Line 44: | Line 44: | ||
You will need to import as a minima the '' | You will need to import as a minima the '' | ||
- | <code julia> | + | < |
- | # Import of the JuMP and DataFrames modules (the latter one just to import the data from a header-based table, as in the original trasnport example in GAMS | + | # Import of the JuMP and DataFrames modules (the latter one just to import the data from a header based table, as in the original trasnport example in GAMS |
using JuMP, DataFrames | using JuMP, DataFrames | ||
</ | </ | ||
Line 56: | Line 56: | ||
<code julia> | <code julia> | ||
- | ## Define sets ## | + | # Define sets # |
# Sets | # Sets | ||
# | # | ||
Line 70: | Line 70: | ||
<code julia> | <code julia> | ||
- | ## Define parameters | + | # Define parameters # |
# | # | ||
# | # | ||
Line 135: | Line 135: | ||
<code julia> | <code julia> | ||
- | # Model declaration | + | # Model declaration |
- | trmodel = Model() | + | trmodel = Model() |
</ | </ | ||
Line 190: | Line 191: | ||
<code julia> | <code julia> | ||
print(trmodel) | print(trmodel) | ||
- | </code | + | </code> |
==== Resolution of the model ==== | ==== Resolution of the model ==== | ||
Line 234: | Line 235: | ||
Here is the complete script: | Here is the complete script: | ||
- | < | + | < |
- | #= | + | # Transposition in JuMP of the basic transport model used in the GAMS tutorial |
- | Transposition in JuMP of the basic transport model used in the GAMS tutorial | + | # |
- | + | # This problem finds a least cost shipping schedule that meets | |
- | This problem finds a least cost shipping schedule that meets | + | # requirements at markets and supplies at factories. |
- | requirements at markets and supplies at factories. | + | # |
- | + | # - Original formulation: | |
- | - Original formulation: | + | # Princeton University Press, Princeton, New Jersey, 1963. |
- | Princeton University Press, Princeton, New Jersey, 1963. | + | # - Gams implementation: |
- | - Gams implementation: | + | # Rosenthal, R E, Chapter 2: A GAMS Tutorial. In GAMS: A User's Guide. |
- | Rosenthal, R E, Chapter 2: A GAMS Tutorial. In GAMS: A User's Guide. | + | # The Scientific Press, Redwood City, California, 1988. |
- | The Scientific Press, Redwood City, California, 1988. | + | # - JuMP implementation: |
- | - JuMP implementation: | + | |
- | =# | + | |
using JuMP, DataFrames | using JuMP, DataFrames |