Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_cep_slack_variables error #36

Closed
holgerteichgraeber opened this issue Oct 8, 2019 · 2 comments
Closed

get_cep_slack_variables error #36

holgerteichgraeber opened this issue Oct 8, 2019 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@holgerteichgraeber
Copy link
Collaborator

holgerteichgraeber commented Oct 8, 2019

region = "CA_14"
ts_input_data = load_timeseries_data_provided(region)
cep_data = load_cep_data_provided(region)
optimizer=Clp.Optimizer
ts_clust_result = run_clust(ts_input_data; method="kmeans", representation="centroid", n_init=5, n_clust=5)
ts_clust_data = ts_clust_result.clust_data
test_result = run_opt(ts_clust_data,cep_data,optimizer;descriptor="Test",transmission = true,infrastructure = Dict{String,Array}("existing"=>["demand","transmission"], "limit"=>["transmission"]),  limit_emission=Dict{String,Number}("CO2/electricity"=>1000));
test_result.variables["TRANS"]
get_cep_slack_variables(test_result)
type OptResult has no field descriptor

Stacktrace:
 [1] getproperty(::Any, ::Symbol) at ./sysimg.jl:18
 [2] macro expansion at ./logging.jl:319 [inlined]
 [3] get_cep_variables(::OptResult, ::String) at /home/holger/.julia/dev/CapacityExpansion/src/utils/utils.jl:54
 [4] get_cep_slack_variables(::OptResult) at /home/holger/.julia/dev/CapacityExpansion/src/utils/utils.jl:38
 [5] top-level scope at In[13]:1

This seems to be an error in get_cep_variables() in utils.jl, potentially here:

 if isempty(variables)
     throw(@error("$variable_type-Variable not provided in $(opt_result.descriptor)"))

Any thoughts on what happened? / was there a change in the most recent dev branch that we have to accomodate here?

@YoungFaithful YoungFaithful added the bug Something isn't working label Oct 11, 2019
@YoungFaithful
Copy link
Owner

There are two things:

  • There are no Slack variables in the result, because neither lost_load_cost nor lost_emission_cost are included and no SLACK variables are setup
  • The error message itself was trying to enter an outdated field. (I fixed that in a new commit)

@holgerteichgraeber
Copy link
Collaborator Author

Great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants