*/
public int getTrialCount(ExecutionContext context) {
List<Element> elements = context.getElementStack();
for (int x=elements.size() - 2; x >= 0; x--) {
if (elements.get(x) instanceof CompoundElement) {
CompoundElement ce = (CompoundElement) elements.get(x);
// check that the stack element succeeding the compound element is the primary element
if (elements.get(x + 1) == ce.getPrimary()) {
if (baseEvaluator != null) {
// return whatever the base evaluator returns, e.g. would return 0 for skip states
return baseEvaluator.getTrialCount(context);
} else {
logger.warn("No base TrialCountEvaluator specified for CompoundElementTrialCountEvaluator.");