// Statistics
private int numOfTransitions;
- private HashMap<Integer, HashSet<Integer>> stateToUniqueEventMap;
+ private HashMap<Integer, HashSet<Integer>> stateToUniqueTransMap;
public DPORStateReducerWithSummary(Config config, JPF jpf) {
verboseMode = config.getBoolean("printout_state_transition", false);
relevantFields = new HashSet<>();
restorableStateMap = new HashMap<>();
stateToPredInfo = new HashMap<>();
- stateToUniqueEventMap = new HashMap<>();
+ stateToUniqueTransMap = new HashMap<>();
initializeStatesVariables();
}
} else {
// We only count IntChoiceFromSet CGs
numOfTransitions++;
- countUniqueStateId(vm.getStateId(), icsCG.getNextChoice());
+ countUniqueTransitions(vm.getStateId(), icsCG.getNextChoice());
}
// Map state to event
mapStateToEvent(icsCG.getNextChoice());
// --- Functions related to statistics counting
// Count unique state IDs
- private void countUniqueStateId(int stateId, int nextChoiceValue) {
+ private void countUniqueTransitions(int stateId, int nextChoiceValue) {
HashSet<Integer> events;
// Get the set of events
- if (!stateToUniqueEventMap.containsKey(stateId)) {
+ if (!stateToUniqueTransMap.containsKey(stateId)) {
events = new HashSet<>();
- stateToUniqueEventMap.put(stateId, events);
+ stateToUniqueTransMap.put(stateId, events);
} else {
- events = stateToUniqueEventMap.get(stateId);
+ events = stateToUniqueTransMap.get(stateId);
}
// Insert the event
if (!events.contains(nextChoiceValue)) {
private int summarizeUniqueTransitions() {
// Just count the set size of each of entry map and sum them up
int numOfUniqueTransitions = 0;
- for (Map.Entry<Integer,HashSet<Integer>> entry : stateToUniqueEventMap.entrySet()) {
+ for (Map.Entry<Integer,HashSet<Integer>> entry : stateToUniqueTransMap.entrySet()) {
numOfUniqueTransitions = numOfUniqueTransitions + entry.getValue().size();
}