Skip to content

Commit

Permalink
minor simplifications in rules execution
Browse files Browse the repository at this point in the history
  • Loading branch information
cobizobi committed Dec 27, 2024
1 parent 84d4983 commit 2f44a5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ public void executeAllOperations() {

public OperationStatus executeOperation(AbstractOperation op) {
stopwatch.start();
List<Transition> transitions = trace.getStateSpace()
.getTransitionsBasedOnParameterValues(trace.getCurrentState(), op.getName(), new ArrayList<>(), 1);
trace = trace.add(transitions.get(0));
trace = trace.execute(op.getName());
OperationStatus opState = evalOperation(trace.getCurrentState(), op);
this.operationStatuses.put(op, opState);
stopwatch.stop();
Expand Down Expand Up @@ -184,10 +182,7 @@ public boolean executeOperationAndDependencies(String opName) {
}

public OperationStatus evalOperation(State state, AbstractOperation operation) {
Set<AbstractOperation> set = new HashSet<>();
set.add(operation);
Map<AbstractOperation, OperationStatus> evalOperations = evalOperations(state, set);
return evalOperations.get(operation);
return evalOperations(state, Collections.singleton(operation)).get(operation);
}

public Map<AbstractOperation, OperationStatus> evalOperations(State state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ public class RulesModelFactory implements ModelFactory<RulesModel> {
}

public ExtractedModel<RulesModel> extract(File runnerFile, RulesProject rulesProject) {
RulesModel rulesModel = modelCreator.get();

rulesModel = rulesModel.create(runnerFile, rulesProject);
return new ExtractedModel<>(stateSpaceProvider, rulesModel);
return new ExtractedModel<>(stateSpaceProvider, modelCreator.get().create(runnerFile, rulesProject));
}

@Override
Expand Down

0 comments on commit 2f44a5d

Please sign in to comment.