This commit is contained in:
Ross
2021-01-17 23:20:09 +00:00
parent 68738a2cfe
commit 3a543ef5b4
5 changed files with 114 additions and 13 deletions
+9 -2
View File
@@ -1,5 +1,7 @@
from pyomo.environ import *
from pyomo.opt import SolverFactory
from pyomo.opt.results import SolverStatus
from shifts import SingleShift, RotaBuilder, RotaResults, days
from workers import Worker
@@ -17,10 +19,10 @@ import operator
use_neos = False
weeks_to_rota = 13
weeks_to_rota = 26
time_to_run = 152000
allow = 2000
allow = 8000
sites = ("truro", "exeter", "torquay", "barnstaple", "plymouth")
@@ -315,6 +317,11 @@ results.solver.status
if not results.solver.status:
sys.exit(0)
# optimizer = SolverFactory('cbc')
# result = optimizer.solve(prob,tee=True)
# result.Solver.Status = SolverStatus.warning
# prob.solutions.load_from(result)
ResultsHolder = RotaResults(Rota, results)
week_table = ResultsHolder.get_work_table() # list with the required workers