@@ 584-596 (lines=13) @@ | ||
581 | * @param duration |
|
582 | * @return |
|
583 | */ |
|
584 | public synchronized Decision create(ComponentValue value, String[] labels, long[] start, long[] end, long[] duration, ExecutionNodeStatus status) |
|
585 | { |
|
586 | // check if value is known to the component |
|
587 | if (!value.getComponent().equals(this)) { |
|
588 | throw new RuntimeException("Trying to add a decision with a value unknown to the component:\n- component: " + this.name + "\n- value: " + value + "\n"); |
|
589 | } |
|
590 | ||
591 | // set decision |
|
592 | Decision dec = new Decision(DecisionIdCounter.getAndIncrement(), value, labels, start, end, duration, status); |
|
593 | // add decision the the agenda |
|
594 | this.decisions.get(PlanElementStatus.PENDING).add(dec); |
|
595 | // get set decision |
|
596 | return dec; |
|
597 | } |
|
598 | ||
599 | /** |
|
@@ 560-572 (lines=13) @@ | ||
557 | * @param duration |
|
558 | * @return |
|
559 | */ |
|
560 | public synchronized Decision create(ComponentValue value, String[] labels, long[] start, long[] end, long[] duration) |
|
561 | { |
|
562 | // check if value is known to the component |
|
563 | if (!value.getComponent().equals(this)) { |
|
564 | throw new RuntimeException("Trying to add a decision with a value unknown to the component:\n- component: " + this.name + "\n- value: " + value + "\n"); |
|
565 | } |
|
566 | ||
567 | // set decision |
|
568 | Decision dec = new Decision(DecisionIdCounter.getAndIncrement(), value, labels, start, end, duration); |
|
569 | // add decision the the agenda |
|
570 | this.decisions.get(PlanElementStatus.PENDING).add(dec); |
|
571 | // get decision |
|
572 | return dec; |
|
573 | } |
|
574 | ||
575 | /** |