| @@ 360-394 (lines=35) @@ | ||
| 357 | * |
|
| 358 | * @return |
|
| 359 | */ |
|
| 360 | public double[] getPlanMakespan() { |
|
| 361 | ||
| 362 | // set the makespan |
|
| 363 | double[] mk = new double[] { |
|
| 364 | Double.MIN_VALUE + 1, |
|
| 365 | Double.MAX_VALUE - 1 |
|
| 366 | }; |
|
| 367 | ||
| 368 | // set update flag |
|
| 369 | boolean update = false; |
|
| 370 | // compute makespan bounds |
|
| 371 | for (DomainComponent c : this.makespan.keySet()) { |
|
| 372 | // check primitive components only |
|
| 373 | if (c.getType().equals(DomainComponentType.SV_PRIMITIVE)) { |
|
| 374 | // update min and max |
|
| 375 | mk[0] = Math.max(mk[0], this.makespan.get(c)[0]); |
|
| 376 | // update max |
|
| 377 | mk[1] = Math.min(mk[1], this.makespan.get(c)[1]); |
|
| 378 | // change update flag |
|
| 379 | update = true; |
|
| 380 | } |
|
| 381 | } |
|
| 382 | ||
| 383 | // check update flag |
|
| 384 | if (!update) { |
|
| 385 | ||
| 386 | // set default data |
|
| 387 | mk = new double[] { |
|
| 388 | 0, |
|
| 389 | Double.MAX_VALUE - 1 |
|
| 390 | }; |
|
| 391 | } |
|
| 392 | ||
| 393 | // get plan makespan |
|
| 394 | return mk; |
|
| 395 | } |
|
| 396 | ||
| 397 | /** |
|
| @@ 401-434 (lines=34) @@ | ||
| 398 | * |
|
| 399 | * @return |
|
| 400 | */ |
|
| 401 | public double[] getPlanHeuristicMakespan() { |
|
| 402 | ||
| 403 | // set heuristic makespan |
|
| 404 | double[] mk = new double[] { |
|
| 405 | Double.MAX_VALUE - 1, |
|
| 406 | Double.MIN_VALUE + 1 |
|
| 407 | }; |
|
| 408 | ||
| 409 | // set update flag |
|
| 410 | boolean update = false; |
|
| 411 | // check heuristic makespan bounds of components |
|
| 412 | for (DomainComponent c : this.heuristicMakespan.keySet()) { |
|
| 413 | // consider primitive components only |
|
| 414 | if (c.getType().equals(DomainComponentType.SV_PRIMITIVE)) { |
|
| 415 | // update min and max |
|
| 416 | mk[0] = Math.min(mk[0], this.heuristicMakespan.get(c)[0]); |
|
| 417 | // update max |
|
| 418 | mk[1] = Math.max(mk[1], this.heuristicMakespan.get(c)[1]); |
|
| 419 | // change update flag |
|
| 420 | update = true; |
|
| 421 | } |
|
| 422 | } |
|
| 423 | ||
| 424 | // check update flag |
|
| 425 | if (!update) { |
|
| 426 | // set default data |
|
| 427 | mk = new double[] { |
|
| 428 | 0, |
|
| 429 | Double.MAX_VALUE - 1 |
|
| 430 | }; |
|
| 431 | } |
|
| 432 | ||
| 433 | // get plan makespan |
|
| 434 | return mk; |
|
| 435 | } |
|
| 436 | ||
| 437 | /** |
|