Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
home_test_julia [2017/02/07 09:24]
antonello created
home_test_julia [2018/06/18 15:11] (current)
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 +Pkg.update()                         
-clusters = ["c1", "c2", "c3", 2,4] +Pkg.add("JuMP")           asdasd           
- +Pkg.add("GLPKMathProgInterface"    
- +Pkg.add("Ipopt"                   
-Parameters +Pkg.add("DataFrames"              
-dist = Dict(r[:cluster],d=> r[Symbol(d)] for r in eachrow(dist_table), d in docks+
- +
-# Model declaration +
-storm = Model() # transport model+
 </code> </code>
  
-not in code 
  
-<code Julia>+<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 using JuMP, DataFrames
 +</code>
  
-# Sets +<code julia> 
-clusters = ["c1", "c2", "c3", 2,4] +Define sets # 
- +#  Sets 
- +#         canning plants   / seattle, san-diego / 
-Parameters +#         markets          / new-york, chicago, topeka / ; 
-dist Dict( (r[:cluster],d) => r[Symbol(d)] for r in eachrow(dist_table)d in docks) +plants  = ["seattle","san_diego"         canning plants 
- +markets = ["new_york","chicago","topeka"]  markets
-# Model declaration +
-storm = Model() transport model+
 </code> </code>
- 
home_test_julia.1486455868.txt.gz · Last modified: 2018/06/18 15:10 (external edit)
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0