Created
April 5, 2021 21:18
-
-
Save samirsaci/7d2021e849bff6fdea0f68897b2c1ad3 to your computer and use it in GitHub Desktop.
Pulp Analysis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Solve Model | |
| model.solve() | |
| # The status of the solution is printed to the screen | |
| print("Status:", LpStatus[model.status]) | |
| # How many workers per day ? | |
| dct_work = {} | |
| for v in model.variables(): | |
| dct_work[int(v.name[-1])] = int(v.varValue) | |
| # Show Detailed Sizing per Day | |
| dict_sch = {} | |
| for day in dct_work.keys(): | |
| dict_sch[day] = [dct_work[day] if i in list_in[day] else 0 for i in n_days] | |
| df_sch = pd.DataFrame(dict_sch).T | |
| df_sch.columns = jours | |
| df_sch.index = start_jours | |
| # The optimized objective function value is printed to the screen | |
| print("Total number of Staff = ", pulp.value(model.objective)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment