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

add additional example - factory schedule MILP #1948

Closed
wants to merge 6 commits into from
Closed

add additional example - factory schedule MILP #1948

wants to merge 6 commits into from

Conversation

Crghilardi
Copy link
Contributor

After getting help on this discourse thread, I wanted to submit the finished problem as a 0.19 ready example.

This pull request adds an additional complete MILP example problem.

Notes:

  1. I originally wrote this using Cbc. I did not see Cbc listed in the Project.TOML and was not sure what the standards were on solver dependencies in testing, so I changed it to GLPK as other examples

  2. This adds 2 data CSV files to the /data folder. Again, didn't want to mess with adding anything so I switched to using DelimitedFiles for reading in data rather than CSV

  3. For file naming I just used problemtype_name.jl, not sure if there is a standard. While clicking through the example folder while working through the problem, I thought more explicit names would be helpful FWIW

This has been tested locally with --project=examples run_examples.jl and I get all tests passed on my machine (72/72)

Copy link
Member

@odow odow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you copy the structure of the other examples and place everything in a function please? Make sure to add a doctoring to the function describing what the example is and where it is from.

examples/milp_factory_schedule.jl Outdated Show resolved Hide resolved
examples/milp_factory_schedule.jl Outdated Show resolved Hide resolved
examples/milp_factory_schedule.jl Outdated Show resolved Hide resolved
examples/milp_factory_schedule.jl Outdated Show resolved Hide resolved
examples/milp_factory_schedule.jl Outdated Show resolved Hide resolved
examples/milp_factory_schedule.jl Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Apr 28, 2019

Codecov Report

Merging #1948 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1948   +/-   ##
=======================================
  Coverage   91.17%   91.17%           
=======================================
  Files          33       33           
  Lines        4147     4147           
=======================================
  Hits         3781     3781           
  Misses        366      366

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94e2cbb...60edfda. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 28, 2019

Codecov Report

Merging #1948 into master will increase coverage by 0.32%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1948      +/-   ##
=========================================
+ Coverage   91.17%   91.5%   +0.32%     
=========================================
  Files          33      33              
  Lines        4147    4212      +65     
=========================================
+ Hits         3781    3854      +73     
+ Misses        366     358       -8
Impacted Files Coverage Δ
src/objective.jl 90.9% <0%> (-4.33%) ⬇️
src/quad_expr.jl 92.66% <0%> (-0.54%) ⬇️
src/parse_expr.jl 88.09% <0%> (-0.07%) ⬇️
src/_Derivatives/subexpressions.jl 100% <0%> (ø) ⬆️
src/macros.jl 93.27% <0%> (+0.26%) ⬆️
src/aff_expr.jl 88.54% <0%> (+0.26%) ⬆️
src/parse_nlp.jl 90.72% <0%> (+0.66%) ⬆️
src/nlp.jl 91.93% <0%> (+0.67%) ⬆️
src/operators.jl 86.89% <0%> (+2.9%) ⬆️
src/optimizer_interface.jl 81.81% <0%> (+4.89%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94e2cbb...ad23b30. Read the comment docs.

Copy link
Member

@odow odow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Just a few minor style comments.

examples/milp_factory_schedule.jl Outdated Show resolved Hide resolved
examples/milp_factory_schedule.jl Outdated Show resolved Hide resolved
examples/milp_factory_schedule.jl Outdated Show resolved Hide resolved
examples/milp_factory_schedule.jl Outdated Show resolved Hide resolved
examples/milp_factory_schedule.jl Outdated Show resolved Hide resolved
#Factory B is shut down during month 5, so production and status are both zero.
@constraints(model, begin
status[5, :B] == 0
production[5, :B]==0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

production[5, :B] == 0

@Crghilardi
Copy link
Contributor Author

I have not looked at this in over a year. I am going to close this PR and submit a new one that is properly branched instead of on master (and fix that space issue...). My fork is so far behind I am having trouble getting everything working again XD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants