| @@ 122-158 (lines=37) @@ | ||
| 119 | } |
|
| 120 | ||
| 121 | // manage controllable tokens of the plan |
|
| 122 | for (ExecutionNode node : this.executive.getNodes(ExecutionNodeStatus.IN_EXECUTION)) { |
|
| 123 | ||
| 124 | // check node controllability |
|
| 125 | if (node.getControllabilityType().equals(ControllabilityType.CONTROLLABLE)) { |
|
| 126 | ||
| 127 | // check end conditions |
|
| 128 | if (this.executive.canEnd(node)) { |
|
| 129 | ||
| 130 | // check node schedule |
|
| 131 | this.executive.checkSchedule(node); |
|
| 132 | // check expected schedule |
|
| 133 | if (tau >= node.getEnd()[0]) { |
|
| 134 | ||
| 135 | // compute (controllable) execution duration |
|
| 136 | long duration = Math.max(1, tau - node.getStart()[0]); |
|
| 137 | // send stop signal to the platform |
|
| 138 | this.executive.sendStopCommandSignalToPlatform(node); |
|
| 139 | // set node as executed |
|
| 140 | this.executive.updateNode(node, ExecutionNodeStatus.EXECUTED); |
|
| 141 | ||
| 142 | // token scheduled |
|
| 143 | info("{Monitor} {tick: " + tick + "} {tau: " + tau + "} -> Scheduling duration for controllable token\n" |
|
| 144 | + "\t- duration: " + duration + "\n" |
|
| 145 | + "\t- node: " + node.getGroundSignature() + " (" + node + ")\n"); |
|
| 146 | } |
|
| 147 | else { |
|
| 148 | ||
| 149 | // wait - not ready for dispatching |
|
| 150 | debug("{Monitor} {tick: " + tick + "} {tau: " + tau + "} -> End conditions satisifed but node schedule not ready for ending\n" |
|
| 151 | + "\t- node: " + node.getGroundSignature() + " (" + node + ")\n"); |
|
| 152 | } |
|
| 153 | } |
|
| 154 | else { |
|
| 155 | ||
| 156 | // print a message in debug mode |
|
| 157 | debug("{Monitor} {tick: " + tick + "} {tau: " + tau + "} -> End execution conditions not satisfied yet\n" |
|
| 158 | + "\t- node: " + node.getGroundSignature() + " (" + node + ")\n"); |
|
| 159 | } |
|
| 160 | } |
|
| 161 | } |
|
| @@ 130-165 (lines=36) @@ | ||
| 127 | } |
|
| 128 | ||
| 129 | // manage controllable tokens of the plan |
|
| 130 | for (ExecutionNode node : this.executive.getNodes(ExecutionNodeStatus.IN_EXECUTION)) { |
|
| 131 | ||
| 132 | // check node controllability |
|
| 133 | if (node.getControllabilityType().equals(ControllabilityType.CONTROLLABLE)) { |
|
| 134 | ||
| 135 | // check end conditions |
|
| 136 | if (this.executive.canEnd(node)) { |
|
| 137 | ||
| 138 | // check node schedule |
|
| 139 | this.executive.checkSchedule(node); |
|
| 140 | // check expected schedule |
|
| 141 | if (tau >= node.getEnd()[0]) { |
|
| 142 | ||
| 143 | // compute (controllable) execution duration |
|
| 144 | long duration = Math.max(1, tau - node.getStart()[0]); |
|
| 145 | // send stop signal to the platform |
|
| 146 | this.executive.sendStopCommandSignalToPlatform(node); |
|
| 147 | // set node as executed |
|
| 148 | this.executive.updateNode(node, ExecutionNodeStatus.EXECUTED); |
|
| 149 | // token scheduled |
|
| 150 | info("{Monitor} {tick: " + tick + "} {tau: " + tau + "} -> Scheduling duration for controllable token\n" |
|
| 151 | + "\t- duration: " + duration + "\n" |
|
| 152 | + "\t- node: " + node.getGroundSignature() + " (" + node + ")\n"); |
|
| 153 | } |
|
| 154 | else { |
|
| 155 | ||
| 156 | // wait - not ready for dispatching |
|
| 157 | debug("{Monitor} {tick: " + tick + "} {tau: " + tau + "} -> End conditions satisifed but node schedule not ready for ending\n" |
|
| 158 | + "\t- node: " + node.getGroundSignature() + " (" + node + ")\n"); |
|
| 159 | } |
|
| 160 | } |
|
| 161 | else { |
|
| 162 | ||
| 163 | // print a message in debug mode |
|
| 164 | debug("{Monitor} {tick: " + tick + "} {tau: " + tau + "} -> End execution conditions not satisfied yet\n" |
|
| 165 | + "\t- node: " + node.getGroundSignature() + " (" + node + ")\n"); |
|
| 166 | } |
|
| 167 | } |
|
| 168 | } |
|