| @@ 1096-1119 (lines=24) @@ | ||
| 1093 | List<SynchronizationRule> rules = this.component.getSynchronizationRules(goal.getDecision().getValue()); |
|
| 1094 | ||
| 1095 | // check rules |
|
| 1096 | if (rules.isEmpty()) { |
|
| 1097 | ||
| 1098 | // create expansion |
|
| 1099 | GoalExpansion expansion = new GoalExpansion(goal, this.expansionCost); |
|
| 1100 | // add expansion |
|
| 1101 | exps.add(expansion); |
|
| 1102 | // print debug message |
|
| 1103 | debug("Simple goal found no synchronization is triggered after expansion:\n" |
|
| 1104 | + "- planning goal: " + goal.getDecision() + "\n"); |
|
| 1105 | ||
| 1106 | ||
| 1107 | } else { |
|
| 1108 | ||
| 1109 | // create a branch for each rule |
|
| 1110 | for (SynchronizationRule rule : rules) { |
|
| 1111 | ||
| 1112 | // expansion solution |
|
| 1113 | GoalExpansion expansion = new GoalExpansion(goal, rule, this.expansionCost); |
|
| 1114 | // add expansion |
|
| 1115 | exps.add(expansion); |
|
| 1116 | // print debug message |
|
| 1117 | debug("Complex goal found:\n" |
|
| 1118 | + "- planning goal: " + goal.getDecision() + "\n" |
|
| 1119 | + "- synchronization rule: " + rule + "\n"); |
|
| 1120 | } |
|
| 1121 | ||
| 1122 | } |
|
| @@ 898-920 (lines=23) @@ | ||
| 895 | ||
| 896 | // check rules |
|
| 897 | List<SynchronizationRule> rules = this.component.getSynchronizationRules(goal.getDecision().getValue()); |
|
| 898 | if (rules.isEmpty()) { |
|
| 899 | ||
| 900 | // the goal can be justified without applying rules |
|
| 901 | GoalExpansion expansion = new GoalExpansion(goal, this.expansionCost); |
|
| 902 | // add expansion |
|
| 903 | expansions.add(expansion); |
|
| 904 | // print debug message |
|
| 905 | debug("Simple goal found no synchronization is triggered after expansion:\n" |
|
| 906 | + "- planning goal: " + goal.getDecision() + "\n"); |
|
| 907 | ||
| 908 | } else { |
|
| 909 | ||
| 910 | // can do expansion |
|
| 911 | for (SynchronizationRule rule : rules) { |
|
| 912 | ||
| 913 | // expansion solution |
|
| 914 | GoalExpansion expansion = new GoalExpansion(goal, rule, this.expansionCost); |
|
| 915 | // add expansion |
|
| 916 | expansions.add(expansion); |
|
| 917 | // print debug message |
|
| 918 | debug("Complex goal found:\n" |
|
| 919 | + "- planning goal: " + goal.getDecision() + "\n" |
|
| 920 | + "- synchronization rule: " + rule + "\n"); |
|
| 921 | } |
|
| 922 | } |
|
| 923 | ||