*
* @return whether the trial is complete
*/
private boolean isCompoundDone(ExecutionContext context, Trial trial) {
Node currElement = context.getActiveElement();
boolean isDone = true;
while (this.getParent() != null
&& this.getParent() != currElement) {
// CompoundElement
if (currElement instanceof CompoundElement) {
CompoundElement comp = (CompoundElement) currElement;
for (Object handler : comp.getHandlers()) {
if (handler instanceof CompoundSelector) {
CompoundSelector selector = (CompoundSelector) handler;
isDone = selector.isDone();
}
}
}
if (currElement.getParent() != null) {
currElement = currElement.getParent();
} else {
return true;
}
}