use of de.prob.model.classicalb.Operation in project prob2 by bendisposto.
the class Transition method getParameterPredicates.
/**
* @return a list of string predicates representing the value of the
* parameters for this transition
*/
public List<String> getParameterPredicates() {
if (isArtificialTransition()) {
return Collections.emptyList();
}
evaluate(FormulaExpand.EXPAND);
List<String> predicates = new ArrayList<>();
AbstractElement mainComponent = stateSpace.getMainComponent();
List<String> paramNames = new ArrayList<>();
if (mainComponent instanceof ClassicalBMachine) {
Operation op = ((ClassicalBMachine) mainComponent).getOperation(getName());
paramNames = op.getParameters();
} else if (mainComponent instanceof EventBMachine) {
Event event = ((EventBMachine) mainComponent).getEvent(getName());
for (EventParameter eventParameter : event.getParameters()) {
paramNames.add(eventParameter.getName());
}
}
if (paramNames.size() == this.params.size()) {
for (int i = 0; i < paramNames.size(); i++) {
predicates.add(paramNames.get(i) + " = " + this.params.get(i));
}
}
return predicates;
}
Aggregations