Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
home_test_julia [2017/02/07 09:24] antonello created |
home_test_julia [2017/02/07 10:15] antonello |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | <code julia> | + | ===== Installation ===== |
- | using JuMP, DataFrames | + | |
- | # Sets | + | **Step 1:** |
- | clusters = [" | + | * Option a: Get an account on [[https:// |
+ | * Option b: Install Julia for your platform ([[http:// | ||
+ | **Step 2:** | ||
- | # Parameters | + | Run, only once, the following code to install JuMP language and a couple of open source solvers: |
- | dist = Dict( (r[: | + | <code julia> |
- | + | Pkg.update() # To refresh the list of newest packages | |
- | # Model declaration | + | Pkg.add(" |
- | storm = Model() # transport model | + | Pkg.add(" |
+ | Pkg.add(" | ||
+ | Pkg.add(" | ||
</ | </ | ||
- | not in code | + | ===== Model components ===== |
- | <code Julia> | + | ==== Importing the libraries ==== |
- | using JuMP, DataFrames | + | |
- | # Sets | + | You will need to import as a minima the '' |
- | clusters = [" | + | |
+ | <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 | ||
+ | using JuMP, DataFrames | ||
+ | </ | ||
- | # Parameters | + | ==== Defining the " |
- | dist = Dict( (r[: | + | |
- | # Model declaration | + | JuMP doesn' |
- | storm = Model() | + | While many works with position-based lists, I find more readable using dictionaries instead. So the " |
+ | One note: it seems that Julia/JuMP don't like much the " | ||
+ | |||
+ | <code julia> | ||
+ | ## Define sets ## | ||
+ | # Sets | ||
+ | # | ||
+ | # | ||
+ | plants | ||
+ | markets | ||
</ | </ | ||
- |