|
1225 | 1225 | "id": "38f7e788", |
1226 | 1226 | "metadata": {}, |
1227 | 1227 | "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", |
1228 | 1234 | "**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." |
1231 | 1237 | ] |
1232 | 1238 | }, |
1233 | 1239 | { |
|
1271 | 1277 | "else:\n", |
1272 | 1278 | " print(\"No task dependencies defined - no constraints needed\")\n", |
1273 | 1279 | "\n", |
1274 | | - "result_exact = scheduler_exact.optimize()\n" |
| 1280 | + "result_exact = scheduler_exact.optimize()" |
1275 | 1281 | ] |
1276 | 1282 | }, |
1277 | 1283 | { |
1278 | 1284 | "cell_type": "markdown", |
1279 | 1285 | "id": "2969cb3f", |
1280 | 1286 | "metadata": {}, |
1281 | 1287 | "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", |
1283 | 1289 | "\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", |
1285 | 1291 | "\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" |
1287 | 1303 | ] |
1288 | 1304 | }, |
1289 | 1305 | { |
|
0 commit comments