Repository: CharJon/GeCO (language: python)

Issue:
generate_params of scheduling.py does not report origin.
By origin I mean the paper.


Discussion / hints:

Fix patch:
diff --git a/geco/mips/scheduling.py b/geco/mips/scheduling.py
deleted file mode 100644
index 6bdf382..0000000
--- a/geco/mips/scheduling.py
+++ /dev/null
@@ -1,231 +0,0 @@
-"""
-This module implements the scheduling problem MIP generation techniques from different papers.
-"""
-
-import itertools
-
-import pyscipopt as scip
-from networkx.utils import py_random_state
-
-
-def hooker_late_tasks_formulation(
-    number_of_facilities,
-    number_of_tasks,
-    time_steps,
-    processing_times,
-    capacities,
-    assignment_costs,
-    release_dates,
-    deadlines,
-):
-    """Generates late tasks mip formulation described in section 4 in
-    Hooker, John. (2005). Planning and Scheduling to Minimize Tardiness. 314-327. 10.1007/11564751_25.
-
-    number_of_facilities: the number of facilities to schedule on
-    number_of_tasks: the number of tasks to assign to facilities
-    time_steps: the number of time steps starting from 0 (corresponds to "N" in the paper)
-    Other parameters follow the same naming used in the paper
-
-    Returns:
-        model: SCIP model of the late tasks instance
-    """
-    model = scip.Model("Hooker Scheduling Late Tasks Formulation")
-    start_time = min(release_dates)
-    time_steps = range(start_time, start_time + time_steps)
-
-    # add variables and their cost
-    L = []
-    for i in range(number_of_tasks):
-        var = model.addVar(lb=0, ub=1, obj=1, name=f"L_{i}", vtype="B")
-        L.append(var)
-
-    # assignment vars
-    x = {}
-    for j, i, t in itertools.product(
-        range(number_of_tasks), range(number_of_facilities), time_steps
-    ):
-        var = model.addVar(lb=0, ub=1, obj=0, name=f"x_{j}_{i}_{t}", vtype="B")
-        x[j, i, t] = var
-
-    # add constraints
-    # constraint (a)
-    for j, t in itertools.product(range(number_of_tasks), time_steps):
-        model.addCons(
-            len(time_steps) * L[j]
-            >= scip.quicksum(
-                (
-                    (t + processing_times[j, i]) * x[j, i, t] - deadlines[j]
-                    for i in range(number_of_facilities)
-                )
-            )
-        )
-
-    # constraint (b)
-    for j in range(number_of_tasks):
-        vars = (
-            x[j, i, t]
-            for i, t in itertools.product(range(number_of_facilities), time_steps)
-        )
-        model.addCons(scip.quicksum(vars) == 1)
-
-    # constraint (c)
-    for i, t in itertools.product(range(number_of_facilities), time_steps):
-        vars = []
-        for j in range(number_of_tasks):
-            vars += [
-                assignment_costs[j, i] * x[j, i, t_prime]
-                for t_prime in range(t - processing_times[j, i] + 1, t + 1)
-                if (j, i, t_prime) in x
-            ]
-        model.addCons(scip.quicksum(vars) <= capacities[i])
-
-    # constraint (d)
-    for i, j, t in itertools.product(
-        range(number_of_facilities), range(number_of_tasks), time_steps
-    ):
-        if t < release_dates[j] or t > len(time_steps) - processing_times[j, i]:
-            model.addCons(x[j, i, t] == 0)
-
-    model.setMinimize()
-
-    return model
-
-
-def generate_hookers_instances():
-    number_of_tasks = [10 + 2 * i for i in range(7)]
-    time_steps = [10, 100]
-    seeds = range(10)
-    for n, t, seed in itertools.product(number_of_tasks, time_steps, seeds):
-        params = 3, n, t, seed
-        yield params, hooker_late_tasks_formulation(
-            *params[:-1], *generate_params(*params[:-1])[:-1]
-        )
-
-
-@py_random_state(2)
-def generate_params(number_of_facilities, number_of_tasks, seed=0):
-    processing_times = {}
-
-    for j, i in itertools.product(range(number_of_tasks), range(number_of_facilities)):
-        if number_of_tasks < 22:
-            processing_times[j, i] = seed.randint(2, 20 + 5 * i)
-        else:
-            processing_times[j, i] = seed.randint(5, 20 + 5 * i)
-
-    capacities = [10] * number_of_facilities
-
-    assignment_costs = {}
-    for i in range(number_of_facilities):
-        value = seed.randint(1, 10)
-        for j in range(number_of_tasks):
-            assignment_costs[j, i] = value
-
-    release_times = [0] * number_of_tasks
-
-    deadlines = {}
-    beta = 20 / 9
-    for j in range(number_of_tasks):
-        deadlines[j] = seed.uniform(beta * number_of_tasks / 4, beta * number_of_tasks)
-
-    resource_requirements = {}
-    for j, k in itertools.product(range(number_of_tasks), range(number_of_facilities)):
-        resource_requirements[j, k] = seed.randint(1, 9)
-
-    return (
-        processing_times,
-        capacities,
-        assignment_costs,
-        release_times,
-        deadlines,
-        resource_requirements,
-    )
-
-
-def heinz_formulation(
-    number_of_facilities,
-    number_of_tasks,
-    processing_times,
-    capacities,
-    assignment_costs,
-    release_dates,
-    deadlines,
-    resource_requirements,
-):
-    """Generates MIP formulation according to Model 4 in
-    Heinz, J. (2013). Recent Improvements Using Constraint Integer Programming for Resource Allocation and Scheduling.
-    In Integration of AI and OR Techniques in Constraint Programming for Combinatorial Optimization Problems
-    (pp. 12–27). Springer Berlin Heidelberg.
-
-
-    number_of_facilities: the number of facilities to schedule on
-    number_of_tasks: the number of tasks to assign to facilities
-    time_steps: the number of time steps starting from 0 (corresponds to "N" in the paper)
-
-    Returns:
-        model: SCIP model of the late tasks instance
-    """
-    model = scip.Model("Heinz Scheduling")
-    time_steps = range(min(release_dates), int(max(deadlines.values())))
-
-    # objective function
-    x = {}
-    for j, k in itertools.product(range(number_of_tasks), range(number_of_facilities)):
-        var = model.addVar(
-            lb=0, ub=1, obj=assignment_costs[j, k], name=f"x_{j}_{k}", vtype="B"
-        )
-        x[j, k] = var
-
-    # y vars
-    y = {}
-    for j, k, t in itertools.product(
-        range(number_of_tasks), range(number_of_facilities), time_steps
-    ):
-        if release_dates[j] <= t <= deadlines[j] - processing_times[j, k]:
-            var = model.addVar(lb=0, ub=1, obj=0, name=f"y_{j}_{k}_{t}", vtype="B")
-            y[j, k, t] = var
-
-    # add constraints
-    # constraint (12)
-    for j in range(number_of_tasks):
-        model.addCons(scip.quicksum(x[j, k] for k in range(number_of_facilities)) == 1)
-
-    # constraint (13)
-    for j, k in itertools.product(range(number_of_tasks), range(number_of_facilities)):
-        model.addCons(
-            scip.quicksum(
-                y[j, k, t]
-                for t in range(
-                    release_dates[j], int(deadlines[j]) - processing_times[j, k]
-                )
-                if t < len(time_steps)
-            )
-            == x[j, k]
-        )
-
-    # constraint (14)
-    for k, t in itertools.product(range(number_of_facilities), time_steps):
-        model.addCons(
-            scip.quicksum(
-                resource_requirements[j, k] * y[j, k, t_prime]
-                for j in range(number_of_tasks)
-                for t_prime in range(t - processing_times[j, k], t + 1)
-                if (j, k, t_prime) in y
-            )
-            <= capacities[k]
-        )
-
-    # constraint (15)
-    epsilon = filter(
-        lambda ts: ts[0] < ts[1], itertools.product(release_dates, deadlines.values())
-    )
-    for k, (t1, t2) in itertools.product(range(number_of_facilities), epsilon):
-        model.addCons(
-            scip.quicksum(
-                processing_times[j, k] * resource_requirements[j, k] * x[j, k]
-                for j in range(number_of_tasks)
-                if t1 <= release_dates[j] and t2 >= deadlines[j]
-            )
-            <= capacities[k] * (t2 - t1)
-        )
-
-    return model
diff --git a/geco/mips/scheduling/__init__.py b/geco/mips/scheduling/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/geco/mips/scheduling/generic.py b/geco/mips/scheduling/generic.py
new file mode 100644
index 0000000..bd72a7b
--- /dev/null
+++ b/geco/mips/scheduling/generic.py
@@ -0,0 +1,77 @@
+import itertools
+
+from networkx.utils import py_random_state
+
+
+@py_random_state(-1)
+def generate_params(number_of_facilities, number_of_tasks, seed=0):
+    """
+    Generic instance parameter generator for heinz [1] and hooker [2] formulations.
+
+    Parameters
+    ----------
+    number_of_facilities: int
+        the number of facilities to schedule on
+    number_of_tasks: int
+        the number of tasks to assign to facilities
+    seed: int, random object or None
+        for randomization
+
+    Returns
+    -------
+    processing_times: dict[int,int]
+        time steps to process each task
+    capacities: list[int]
+        capacity of each facility
+    assignment_costs: dict[int,int]
+        cost of assigning a task to a facility
+    release_times: list[int]
+        time step at which a job is released
+    deadlines: dict[int, float]
+        deadline (time step) to finish a job
+    resource_requirements: dict[int,int]
+        resources required for each task assigned to a facility
+
+    References
+    ----------
+    .. [1] Heinz, J. (2013). Recent Improvements Using Constraint Integer Programming for Resource Allocation and Scheduling.
+    In Integration of AI and OR Techniques in Constraint Programming for Combinatorial Optimization Problems
+    (pp. 12–27). Springer Berlin Heidelberg.
+    .. [2] Hooker, John. (2005). Planning and Scheduling to Minimize
+     Tardiness. 314-327. 10.1007/11564751_25.
+    """
+    processing_times = {}
+
+    for j, i in itertools.product(range(number_of_tasks), range(number_of_facilities)):
+        if number_of_tasks < 22:
+            processing_times[j, i] = seed.randint(2, 20 + 5 * i)
+        else:
+            processing_times[j, i] = seed.randint(5, 20 + 5 * i)
+
+    capacities = [10] * number_of_facilities
+
+    assignment_costs = {}
+    for i in range(number_of_facilities):
+        value = seed.randint(1, 10)
+        for j in range(number_of_tasks):
+            assignment_costs[j, i] = value
+
+    release_times = [0] * number_of_tasks
+
+    deadlines = {}
+    beta = 20 / 9
+    for j in range(number_of_tasks):
+        deadlines[j] = seed.uniform(beta * number_of_tasks / 4, beta * number_of_tasks)
+
+    resource_requirements = {}
+    for j, k in itertools.product(range(number_of_tasks), range(number_of_facilities)):
+        resource_requirements[j, k] = seed.randint(1, 9)
+
+    return (
+        processing_times,
+        capacities,
+        assignment_costs,
+        release_times,
+        deadlines,
+        resource_requirements,
+    )
diff --git a/geco/mips/scheduling/heinz.py b/geco/mips/scheduling/heinz.py
new file mode 100644
index 0000000..904f0b4
--- /dev/null
+++ b/geco/mips/scheduling/heinz.py
@@ -0,0 +1,185 @@
+import itertools
+
+import pyscipopt as scip
+from networkx.utils import py_random_state
+from geco.mips.scheduling.generic import *
+
+
+@py_random_state(-1)
+def heinz_params(number_of_facilities, number_of_tasks, seed=0):
+    """Generates scheduling MIP instance params according to [1].
+
+    Parameters
+    ----------
+    number_of_facilities: int
+        the number of facilities to schedule on
+    number_of_tasks: int
+        the number of tasks to assign to facilities
+    seed: int, random object or None
+        for randomization
+
+    Returns
+    -------
+    processing_times: dict[int,int]
+        time steps to process each task
+    capacities: list[int]
+        capacity of each facility
+    assignment_costs: dict[int,int]
+        cost of assigning a task to a facility
+    release_times: list[int]
+        time step at which a job is released
+    deadlines: dict[int, float]
+        deadline (time step) to finish a job
+    resource_requirements: dict[int,int]
+        resources required for each task assigned to a facility
+
+    References
+    ----------
+    .. [1] Heinz, J. (2013). Recent Improvements Using Constraint Integer Programming for Resource Allocation and Scheduling.
+    In Integration of AI and OR Techniques in Constraint Programming for Combinatorial Optimization Problems
+    (pp. 12–27). Springer Berlin Heidelberg.
+    """
+    return generate_params(number_of_facilities, number_of_tasks, seed)
+
+
+@py_random_state(-1)
+def heinz_instance(number_of_facilities, number_of_tasks, seed=0):
+    """Generates scheduling MIP instance according to [1].
+
+    Parameters
+    ----------
+    number_of_facilities: int
+        the number of facilities to schedule on
+    number_of_tasks: int
+        the number of tasks to assign to facilities
+    seed: int, random object or None
+        for randomization
+
+    Returns
+    -------
+        model: SCIP model of generated instance
+
+    References
+    ----------
+    .. [1] Heinz, J. (2013). Recent Improvements Using Constraint Integer Programming for Resource Allocation and Scheduling.
+    In Integration of AI and OR Techniques in Constraint Programming for Combinatorial Optimization Problems
+    (pp. 12–27). Springer Berlin Heidelberg.
+    """
+    return heinz_formulation(
+        number_of_facilities,
+        number_of_tasks,
+        *heinz_params(number_of_facilities, number_of_tasks, seed),
+        name="Heinz Scheduling Instance",
+    )
+
+
+def heinz_formulation(
+    number_of_facilities,
+    number_of_tasks,
+    processing_times,
+    capacities,
+    assignment_costs,
+    release_dates,
+    deadlines,
+    resource_requirements,
+    name="Heinz Scheduling Formulation",
+):
+    """Generates scheduling MIP formulation according to Model 4 in [1].
+
+    Parameters
+    ----------
+    number_of_facilities: int
+        the number of facilities to schedule on
+    number_of_tasks: int
+        the number of tasks to assign to facilities
+    processing_times: dict[int,int]
+        time steps to process each task
+    capacities: list[int]
+        capacity of each facility
+    assignment_costs: dict[int,int]
+        cost of assigning a task to a facility
+    release_dates: list[int]
+        time step at which a job is released
+    deadlines: dict[int, float]
+        deadline (time step) to finish a job
+    resource_requirements: dict[int,int]
+        resources required for each task assigned to a facility
+    name: str
+        assigned name to generated instance
+
+    Returns
+    -------
+        model: SCIP model of generated instance
+
+    References
+    ----------
+    .. [1] Heinz, J. (2013). Recent Improvements Using Constraint Integer Programming for Resource Allocation and Scheduling.
+    In Integration of AI and OR Techniques in Constraint Programming for Combinatorial Optimization Problems
+    (pp. 12–27). Springer Berlin Heidelberg.
+    """
+    model = scip.Model(name)
+
+    time_steps = range(min(release_dates), int(max(deadlines.values())))
+
+    # objective function
+    x = {}
+    for j, k in itertools.product(range(number_of_tasks), range(number_of_facilities)):
+        var = model.addVar(
+            lb=0, ub=1, obj=assignment_costs[j, k], name=f"x_{j}_{k}", vtype="B"
+        )
+        x[j, k] = var
+
+    # y vars
+    y = {}
+    for j, k, t in itertools.product(
+        range(number_of_tasks), range(number_of_facilities), time_steps
+    ):
+        if release_dates[j] <= t <= deadlines[j] - processing_times[j, k]:
+            var = model.addVar(lb=0, ub=1, obj=0, name=f"y_{j}_{k}_{t}", vtype="B")
+            y[j, k, t] = var
+
+    # add constraints
+    # constraint (12)
+    for j in range(number_of_tasks):
+        model.addCons(scip.quicksum(x[j, k] for k in range(number_of_facilities)) == 1)
+
+    # constraint (13)
+    for j, k in itertools.product(range(number_of_tasks), range(number_of_facilities)):
+        model.addCons(
+            scip.quicksum(
+                y[j, k, t]
+                for t in range(
+                    release_dates[j], int(deadlines[j]) - processing_times[j, k]
+                )
+                if t < len(time_steps)
+            )
+            == x[j, k]
+        )
+
+    # constraint (14)
+    for k, t in itertools.product(range(number_of_facilities), time_steps):
+        model.addCons(
+            scip.quicksum(
+                resource_requirements[j, k] * y[j, k, t_prime]
+                for j in range(number_of_tasks)
+                for t_prime in range(t - processing_times[j, k], t + 1)
+                if (j, k, t_prime) in y
+            )
+            <= capacities[k]
+        )
+
+    # constraint (15)
+    epsilon = filter(
+        lambda ts: ts[0] < ts[1], itertools.product(release_dates, deadlines.values())
+    )
+    for k, (t1, t2) in itertools.product(range(number_of_facilities), epsilon):
+        model.addCons(
+            scip.quicksum(
+                processing_times[j, k] * resource_requirements[j, k] * x[j, k]
+                for j in range(number_of_tasks)
+                if t1 <= release_dates[j] and t2 >= deadlines[j]
+            )
+            <= capacities[k] * (t2 - t1)
+        )
+
+    return model
diff --git a/geco/mips/scheduling/hooker.py b/geco/mips/scheduling/hooker.py
new file mode 100644
index 0000000..bfa6342
--- /dev/null
+++ b/geco/mips/scheduling/hooker.py
@@ -0,0 +1,185 @@
+import itertools
+
+import pyscipopt as scip
+from networkx.utils import py_random_state
+from geco.mips.scheduling.generic import *
+
+
+@py_random_state(-1)
+def hooker_params(number_of_facilities, number_of_tasks, seed=0):
+    """Generates late tasks mip instance described in section 4 in [1].
+
+    Parameters
+    ----------
+    number_of_facilities: int
+        the number of facilities to schedule on
+    number_of_tasks: int
+        the number of tasks to assign to facilities
+    seed: int, random object or None
+        for randomization
+
+    Returns
+    -------
+    processing_times: dict[int,int]
+        time steps to process each task
+    capacities: list[int]
+        capacity of each facility
+    assignment_costs: dict[int,int]
+        cost of assigning a task to a facility
+    release_times: list[int]
+        time step at which a job is released
+    deadlines: dict[int, float]
+        deadline (time step) to finish a job
+
+    References
+    ----------
+    .. [1] Hooker, John. (2005). Planning and Scheduling to Minimize
+     Tardiness. 314-327. 10.1007/11564751_25.
+    """
+    return generate_params(number_of_facilities, number_of_tasks, seed)[:-1]
+
+
+@py_random_state(-1)
+def hooker_instance(number_of_facilities, number_of_tasks, time_steps, seed=0):
+    """Generates late tasks mip instance described in section 4 in [1].
+
+    Parameters
+    ----------
+    number_of_facilities: int
+        the number of facilities to schedule on
+    number_of_tasks: int
+        the number of tasks to assign to facilities
+    time_steps:
+        the number of time steps starting from 0 (corresponds to "N" in the paper)
+
+    Returns
+    -------
+        model: SCIP model of the late tasks instance
+
+    References
+    ----------
+    .. [1] Hooker, John. (2005). Planning and Scheduling to Minimize
+     Tardiness. 314-327. 10.1007/11564751_25.
+    """
+    return hooker_formulation(
+        number_of_facilities,
+        number_of_tasks,
+        time_steps,
+        *hooker_params(number_of_facilities, number_of_tasks, seed),
+        name="Hooker Scheduling Instance",
+    )
+
+
+def hooker_formulation(
+    number_of_facilities,
+    number_of_tasks,
+    time_steps,
+    processing_times,
+    capacities,
+    assignment_costs,
+    release_dates,
+    deadlines,
+    name="Hooker Scheduling Late Tasks Formulation",
+):
+    """Generates late tasks mip formulation described in section 4 in [1].
+
+    Parameters
+    ----------
+    number_of_facilities: int
+        the number of facilities to schedule on
+    number_of_tasks: int
+        the number of tasks to assign to facilities
+    time_steps:
+        the number of time steps starting from 0 (corresponds to "N" in the paper)
+    processing_times: dict[int,int]
+        time steps to process each task
+    capacities: list[int]
+        capacity of each facility
+    assignment_costs: dict[int,int]
+        cost of assigning a task to a facility
+    release_dates: list[int]
+        time step at which a job is released
+    deadlines: dict[int, float]
+        deadline (time step) to finish a job
+    name: str
+        assigned name to generated instance
+
+    Returns
+    -------
+        model: SCIP model of the late tasks instance
+
+    References
+    ----------
+    .. [1] Hooker, John. (2005). Planning and Scheduling to Minimize
+     Tardiness. 314-327. 10.1007/11564751_25.
+    """
+    model = scip.Model(name)
+
+    start_time = min(release_dates)
+    time_steps = range(start_time, start_time + time_steps)
+
+    # add variables and their cost
+    L = []
+    for i in range(number_of_tasks):
+        var = model.addVar(lb=0, ub=1, obj=1, name=f"L_{i}", vtype="B")
+        L.append(var)
+
+    # assignment vars
+    x = {}
+    for j, i, t in itertools.product(
+        range(number_of_tasks), range(number_of_facilities), time_steps
+    ):
+        var = model.addVar(lb=0, ub=1, obj=0, name=f"x_{j}_{i}_{t}", vtype="B")
+        x[j, i, t] = var
+
+    # add constraints
+    # constraint (a)
+    for j, t in itertools.product(range(number_of_tasks), time_steps):
+        model.addCons(
+            len(time_steps) * L[j]
+            >= scip.quicksum(
+                (
+                    (t + processing_times[j, i]) * x[j, i, t] - deadlines[j]
+                    for i in range(number_of_facilities)
+                )
+            )
+        )
+
+    # constraint (b)
+    for j in range(number_of_tasks):
+        vars = (
+            x[j, i, t]
+            for i, t in itertools.product(range(number_of_facilities), time_steps)
+        )
+        model.addCons(scip.quicksum(vars) == 1)
+
+    # constraint (c)
+    for i, t in itertools.product(range(number_of_facilities), time_steps):
+        vars = []
+        for j in range(number_of_tasks):
+            vars += [
+                assignment_costs[j, i] * x[j, i, t_prime]
+                for t_prime in range(t - processing_times[j, i] + 1, t + 1)
+                if (j, i, t_prime) in x
+            ]
+        model.addCons(scip.quicksum(vars) <= capacities[i])
+
+    # constraint (d)
+    for i, j, t in itertools.product(
+        range(number_of_facilities), range(number_of_tasks), time_steps
+    ):
+        if t < release_dates[j] or t > len(time_steps) - processing_times[j, i]:
+            model.addCons(x[j, i, t] == 0)
+
+    model.setMinimize()
+
+    return model
+
+
+def generate_hookers_instances():
+    number_of_tasks = [10 + 2 * i for i in range(7)]
+    time_steps = [10, 100]
+    seeds = range(10)
+    for n, t, seed in itertools.product(number_of_tasks, time_steps, seeds):
+        params = 3, n, t, seed
+        yield params, hooker_instance(*params)


Test patch:
diff --git a/geco/mips/tests/test_scheduling.py b/geco/mips/tests/test_scheduling.py
index 1cd6632..0c6b5f4 100644
--- a/geco/mips/tests/test_scheduling.py
+++ b/geco/mips/tests/test_scheduling.py
@@ -1,19 +1,18 @@
 import pytest
 
-from geco.mips.scheduling import *
+from geco.mips.scheduling.heinz import *
+from geco.mips.scheduling.hooker import *
 
 
-def test_late_tasks_formulation():
-    main_params = number_of_facilities, number_of_tasks, time_steps = 3, 10, 100
-    params = p, C, c, R, d = generate_params(*main_params[:-1], seed=0)[:-1]
-
-    model = hooker_late_tasks_formulation(*main_params, *params)
-    check_hookers_instance(model, number_of_facilities, number_of_tasks, time_steps)
+def test_hooker_formulation():
+    params = number_of_facilities, number_of_tasks, time_steps = 3, 10, 100
+    model = hooker_instance(*params)
+    _check_hookers_instance(model, number_of_facilities, number_of_tasks, time_steps)
 
 
 def test_hooker_generation():
     for params, model in generate_hookers_instances():
-        check_hookers_instance(model, *params[:-1])
+        _check_hookers_instance(model, *params[:-1])
 
 
 @pytest.mark.parametrize(
@@ -22,9 +21,9 @@ def test_hooker_generation():
 )
 def test_heinz_formulation(number_of_facilities, number_of_tasks, seed):
     main_params = number_of_facilities, number_of_tasks
-    params = p, C, c, R, d, r = generate_params(*main_params, seed)
+    p, C, c, R, d, r = heinz_params(*main_params, seed)
     time_steps = int(max(d.values()) - min(R))
-    model = heinz_formulation(*main_params, *params)
+    model = heinz_instance(*main_params)
     x_vars_count = number_of_facilities * number_of_tasks
     y_vars_lowerbound = 0
     y_vars_upperbound = number_of_facilities * number_of_tasks * time_steps
@@ -68,7 +67,7 @@ def test_param_generation_seeding(n_resources, n_tasks, seed1, seed2):
 
 
 def test_hooker_simple_instance():
-    hooker_model = hooker_late_tasks_formulation(*simple_instance_params()[:-1])
+    hooker_model = hooker_formulation(*_simple_instance_params()[:-1])
     hooker_model.hideOutput()
     hooker_model.optimize()
     assert hooker_model.getStatus() == "optimal"
@@ -86,7 +85,7 @@ def test_heinz_simple_instance():
         release_times,
         deadlines,
         resource_requirements,
-    ) = simple_instance_params()
+    ) = _simple_instance_params()
     heinz_model = heinz_formulation(
         n_resources,
         n_tasks,
@@ -103,7 +102,7 @@ def test_heinz_simple_instance():
     assert heinz_model.getObjVal() == 1
 
 
-def simple_instance_params():
+def _simple_instance_params():
     n_resources = 1
     n_tasks = 1
     time_steps = 1
@@ -128,7 +127,7 @@ def simple_instance_params():
     )
 
 
-def check_hookers_instance(model, number_of_facilities, number_of_tasks, time_steps):
+def _check_hookers_instance(model, number_of_facilities, number_of_tasks, time_steps):
     assert (
         model.getNVars()
         == number_of_facilities * number_of_tasks * time_steps + number_of_tasks