<commit_before>package monitoring.impl.monitors;

import monitoring.impl.IncrementalMonitor;
import structure.impl.SimpleDetQEA;
import structure.impl.Verdict;
import exceptions.ShouldNotHappenException;

/**
 * A small-step monitor for a simple QEA with no quantified variables
 * 
 * @author <NAME>
 * @author <NAME>
 */
public class IncrementalPropositionalQEAMonitor extends
		IncrementalMonitor<SimpleDetQEA> {

	private int currentState;

	public IncrementalPropositionalQEAMonitor(SimpleDetQEA qea) {
		super(qea);
		currentState = qea.getInitialState(); // Set initial state
	}

	@Override
	public Verdict step(int eventName, Object[] args) {
		throw new ShouldNotHappenException(
				"Never call propositional QEA with arguments");
	}

	@Override
	public Verdict step(int eventName) {

		// Update state
		currentState = qea.getNextState(currentState, eventName);

		// Determine verdict according to the state
		if (qea.isStateFinal(currentState)) {
			return Verdict.WEAK_SUCCESS;
		}
		return Verdict.WEAK_FAILURE;
	}

	@Override
	public Verdict end() {

		// Determine verdict according to the state
		if (qea.isStateFinal(currentState)) {
			return Verdict.SUCCESS;
		}
		return Verdict.FAILURE;
	}

}<commit_msg>*Current state changed to be represented as a NonDetConfig instead of an integer<commit_after>package monitoring.impl.monitors;

import monitoring.impl.IncrementalMonitor;
import monitoring.impl.configs.DetConfig;
import structure.impl.SimpleDetQEA;
import structure.impl.Verdict;
import exceptions.ShouldNotHappenException;

/**
 * A small-step monitor for a simple QEA with no quantified variables
 * 
 * @author <NAME>
 * @author <NAME>
 */
public class IncrementalPropositionalQEAMonitor extends
		IncrementalMonitor<SimpleDetQEA> {

	/**
	 * Current configuration (state) for the monitor
	 */
	private DetConfig currentConfig;

	public IncrementalPropositionalQEAMonitor(SimpleDetQEA qea) {
		super(qea);
		currentConfig.setState(qea.getInitialState());
	}

	@Override
	public Verdict step(int eventName, Object[] args) {
		throw new ShouldNotHappenException(
				"Never call propositional QEA with arguments");
	}

	@Override
	public Verdict step(int eventName) {

		// Update state
		currentConfig.setState(qea.getNextState(currentConfig.getState(),
				eventName));

		// Determine verdict according to the state
		if (qea.isStateFinal(currentConfig.getState())) {
			return Verdict.WEAK_SUCCESS;
		}
		return Verdict.WEAK_FAILURE;
	}

	@Override
	public Verdict end() {

		// Determine verdict according to the state
		if (qea.isStateFinal(currentConfig.getState())) {
			return Verdict.SUCCESS;
		}
		return Verdict.FAILURE;
	}

}
{'fraction_non_alphanumeric': 0.09073865766779153, 'fraction_numerical': 0.0, 'mean_word_length': 4.73763440860215, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5713833', 'n_tokens_mistral': 882, 'n_tokens_neox': 803, 'n_words': 207}