From 92b26fa42ab7884c304d1f2239607bb23a63c039 Mon Sep 17 00:00:00 2001 From: Lewis Woolfson Date: Tue, 26 May 2020 22:33:13 +0100 Subject: [PATCH] added LP structure --- modelling/scheduler.py | 64 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/modelling/scheduler.py b/modelling/scheduler.py index e69de29..8349717 100644 --- a/modelling/scheduler.py +++ b/modelling/scheduler.py @@ -0,0 +1,64 @@ +import pandas as pd +import numpy as np +import pyomo.environ as pe +import pyomo.gdp as pyogdp +from pyomo.core.base.set_types import Any + + +# check with Taha if code is too similar to Alstom? +class TheatreScheduler: + + def __init__(self): + pass + + def _generate_cases(self): + pass + + def create_model(self): + model = pe.ConcreteModel() + + # Model Data + model.CASES = pe.Set() # indexed by (caseID, sessionID) + model.CASE_DURATIONS = pe.Param() # median case times + model.SESSION_DURATIONS = pe.param() # session durations + model.M = pe.Param() # big M + max_util = 0.85 + + # Decision Variables + model.SESSION_ASSIGNED = pe.Var() + model.CASE_START_TIME = pe.Var() + model.UTILISATION = pe.Var() + + # Objective + def objective_function(model): + pass + model.OBJECTIVE = pe.Objective() + + # Constraints + # Case start time must be after start time of assigned theatre session + def case_start_time(): + pass + model.CASE_START = pe.Constraint() + + # Case end time must be before end time of assigned theatre session + def case_end_time(): + pass + model.CASE_END_TIME = pe.Constraint() + + # Cases can be assigned to a maximum of one session + def session_assignment(): + pass + model.SESSION_ASSIGNMENT = pe.Constraint() + + def disjunctions(): + pass + model.DISJUNCTIONS = pyogdp.Disjunction() + + def theatre_util(): + pass + model.THEATRE_UTIL = pe.Constraint() + + return model + + def solve(self): + pass