Skip to main content

Save Julia Gurobi model and load and run with different datainputs

Ongoing

Comments

2 comments

  • Jonasz Staszek
    • Community Moderator Community Moderator
    • Gurobi-versary
    • Thought Leader
    • First Question

    Hi Katinka,

    I'm no expert in Julia, but perhaps it is possible to export a module (in particular I mean to export the methods which you use to generate the model, then load them someplace else and use them with new data)?

    Best regards
    Jonasz

    1
  • Katinka Klepsch
    • Gurobi-versary
    • First Comment
    • First Question

    Thanks! That helps.

    However I cannot use the variable (eg x) in another fil when I try to use x. And I when I try to return x in my function in the module, it just returns the model instead. Do you know why? :-)

    include("01initial_model_module.jl")
    using JuMP
    using Gurobi

    using .model_module_test
    path_to_data = "data_final_v1.jl" # path to data
    model = deterministic_model_test(path_to_data)
    optimize!(model)
    if termination_status(model) == MOI.OPTIMAL
          xres=value.(x) ---> ERROR
    end
     
     
     
    0

Please sign in to leave a comment.