return stateSummary.keySet();
}
- public ReadWriteSet getRWSetForEventChoiceAtState(int choice, int stateId) {
+ public ReadWriteSet getRWSetForEventChoiceAtState(int eventChoice, int stateId) {
HashMap<Integer, ReadWriteSet> stateSummary = mainSummary.get(stateId);
- return stateSummary.get(choice);
+ return stateSummary.get(eventChoice);
}
private ReadWriteSet performUnion(ReadWriteSet recordedRWSet, ReadWriteSet rwSet) {
// E.g. if we have a conflict between 1 and 3, then we create the list {3, 1, 0, 2}
// for the original set {0, 1, 2, 3}
- // eventChoice represent the event/transaction that will be put into the backtracking set of
+ // eventChoice represents the event/transaction that will be put into the backtracking set of
// conflictExecution/conflictChoice
Integer[] newChoiceList = new Integer[refChoices.length];
ArrayList<TransitionEvent> conflictTrace = conflictExecution.getExecutionTrace();
ArrayList<TransitionEvent> conflictTrace = conflictExecution.getExecutionTrace();
HashMap<Integer, ReadWriteSet> confRWFieldsMap = conflictExecution.getReadWriteFieldsMap();
// Skip if this event does not have any Read/Write set or the two events are basically the same event (number)
- if (!confRWFieldsMap.containsKey(conflictChoice) ||
- eventChoice == conflictTrace.get(conflictChoice).getChoice()) {
+ if (!confRWFieldsMap.containsKey(conflictChoice) || eventChoice == conflictTrace.get(conflictChoice).getChoice()) {
return false;
}
// R/W set of choice/event that may have a potential conflict
// Update the backtrack sets from previous executions
private void updateBacktrackSetsFromGraph(int stateId, Execution currExecution, int currChoice) {
// Get events/choices at this state ID
- Set<Integer> eventsAtStateId = mainSummary.getEventChoicesAtStateId(stateId);
- for (Integer event : eventsAtStateId) {
+ Set<Integer> eventChoicesAtStateId = mainSummary.getEventChoicesAtStateId(stateId);
+ for (Integer eventChoice : eventChoicesAtStateId) {
// Get the ReadWriteSet object for this event at state ID
- ReadWriteSet rwSet = mainSummary.getRWSetForEventChoiceAtState(event, stateId);
+ ReadWriteSet rwSet = mainSummary.getRWSetForEventChoiceAtState(eventChoice, stateId);
// Memorize visited TransitionEvent object while performing backward DFS to avoid getting caught up in a cycle
HashSet<TransitionEvent> visited = new HashSet<>();
// Update the backtrack sets recursively
- updateBacktrackSetDFS(currExecution, currChoice, event, rwSet, visited);
+ updateBacktrackSetDFS(currExecution, currChoice, eventChoice, rwSet, visited);
}
}
}