use of de.prob.model.classicalb.ClassicalBMachine 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;
}
use of de.prob.model.classicalb.ClassicalBMachine in project prob2 by bendisposto.
the class RulesModelFactory method extract.
public ExtractedModel<RulesModel> extract(File runnerFile, RulesProject rulesProject) {
RulesModel rulesModel = modelCreator.get();
rulesModel = rulesModel.create(runnerFile, rulesProject);
return new ExtractedModel<>(rulesModel, new ClassicalBMachine(rulesProject.getBModels().get(0).getMachineName()));
}
Aggregations