Skip to content

Commit 6356ba4

Browse files
committed
Updated the scheduler tutorial to explain more about the dependency offset constraints
- explained differences between 'minimum' and 'exact' in how the constraints work
1 parent 35072dd commit 6356ba4

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

famodel/irma/scheduler_tutorial.ipynb

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,9 +1225,15 @@
12251225
"id": "38f7e788",
12261226
"metadata": {},
12271227
"source": [
1228+
"In this example, we have additional inputs that specify that Task 0 (Install Mooring) must be done AT LEAST 1 period (offset) after Task 1 (Install Anchor) starts. The constraints that it makes are like the following:\n",
1229+
"\n",
1230+
"$ X_{t,s}[0,0] + X_{t,s}[1,0] \\leq 1 \\quad X_{t,s}[0,0] + X_{t,s}[1,1] \\leq 1 \\quad X_{t,s}[0,1] + X_{t,s}[1,1] \\leq 1 $\n",
1231+
"\n",
1232+
"which says that if Task 1 starts in period 0, then Task 0 cannot start in period 0 (but it could start anywhere else). Similarly, if Task 1 starts in period 1, then Task 0 cannot start in period 0 nor 1.\n",
1233+
"\n",
12281234
"**Notes**:\n",
1229-
"- This minimum example does coincidentally allows Task 0 to start 1 period after the start of Task 1, but it wasn't required too.\n",
1230-
"- Using the dependency type of 'finish_start' creates 1's in Xta variables in the constraints. Using 'start_start' does not include 1's in the constraint row"
1235+
"- Task 0 does not have to start exactly 1 period after Task 1 starts (for this case), but it will try too since there are penalty objective values on later start times\n",
1236+
"- Using the dependency type of 'finish_start' creates 1's in Xta variables in the constraints because the duration of the 'finish' depends on the duration of the specific task-asset group combination. Using 'start_start' does not include 1's in the constraint row because it does not require information about the duration."
12311237
]
12321238
},
12331239
{
@@ -1271,19 +1277,29 @@
12711277
"else:\n",
12721278
" print(\"No task dependencies defined - no constraints needed\")\n",
12731279
"\n",
1274-
"result_exact = scheduler_exact.optimize()\n"
1280+
"result_exact = scheduler_exact.optimize()"
12751281
]
12761282
},
12771283
{
12781284
"cell_type": "markdown",
12791285
"id": "2969cb3f",
12801286
"metadata": {},
12811287
"source": [
1282-
"Can add more explanation for how the constraints look for different dependency offsets.\n",
1288+
"In this example, we run the same scenario but specify that Task 0 MUST start EXACTLY 1 period after the start of Task 1. The constraints are made like the following\n",
12831289
"\n",
1284-
"They mainly update the $X_{t,s}$ variables to ensure each task does not start in a period that would violate the dependency.\n",
1290+
"$$ -X_{t,s}[0,1] + X_{t,s}[1,0] \\leq 0 $$\n",
12851291
"\n",
1286-
"There are some -1's in the 'exact' method to ensure that a certain start period does exactly happen for a task"
1292+
"$$ X_{t,s}[0,0] + X_{t,s}[1,0] \\leq 1 \\quad X_{t,s}[0,2] + X_{t,s}[1,0] \\leq 1 \\quad X_{t,s}[0,3] + X_{t,s}[1,0] \\leq 1 $$\n",
1293+
"\n",
1294+
"which says in the first equation first, if Task 1 starts in period 0, then Task 0 must start in period 1. And in the second set of equations, if Task 1 starts in period 0, then Task 0 cannot start in any other period (0, 2, 3, 4)."
1295+
]
1296+
},
1297+
{
1298+
"cell_type": "markdown",
1299+
"id": "677af285",
1300+
"metadata": {},
1301+
"source": [
1302+
"Can add more explanations/examples for different dependency types and offsets"
12871303
]
12881304
},
12891305
{

0 commit comments

Comments
 (0)