Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| home_test_julia [2017/02/07 08:24] – created antonello | home_test_julia [2025/07/01 13:57] (current) – antonello | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | Run, only once, the following code to install JuMP language and a couple of open source solvers: | ||
| <code julia> | <code julia> | ||
| - | using JuMP, DataFrames | ||
| - | |||
| - | # Sets | ||
| - | clusters = [" | ||
| - | |||
| - | |||
| - | # Parameters | ||
| - | dist = Dict( (r[: | ||
| - | # Model declaration | + | Pkg.update() |
| - | storm = Model() # transport model | + | Pkg.add(" |
| + | Pkg.add(" | ||
| + | Pkg.add(" | ||
| + | Pkg.add(" | ||
| </ | </ | ||
| - | not in code | ||
| - | < | + | < |
| + | # 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 | ||
| + | </ | ||
| - | # Sets | + | <code julia> |
| - | clusters | + | # Define sets # |
| - | + | # | |
| - | + | # | |
| - | # Parameters | + | # |
| - | dist = Dict( (r[:cluster],d) => r[Symbol(d)] for r in eachrow(dist_table), d in docks) | + | plants |
| - | + | markets | |
| - | # Model declaration | + | |
| - | storm = Model() | + | |
| </ | </ | ||
| + | {{: | ||
