/* * CSP Project * Authors: * Jay Bernardo * Matt Rancourt * * File: Restart.java * * Contains the Restart class. The Restart transition is responsible for setting the formula * back to the original formula before we began changing it */ class Restart extends Transition{ CSP originalF; /** * Constructor * @param M - Assignment * @param F - Formula * @throws RelationNumberOutOfBoundsException * @throws RankOutOfBoundsException * @throws InvalidVariableNamesLengthException * @throws InvalidVariableValueException */ public Restart(TransitionAssignment M, CSP F) throws RelationNumberOutOfBoundsException, RankOutOfBoundsException, InvalidVariableNamesLengthException, InvalidVariableValueException{ super(M, F); originalF = F.duplicate(); } /** * Resets the assignment and that's all. * * NOTE: Since we cannot set the formula to a duplicate of the * original and have the changes propagate upward, the * caller of doTransition must manually set the given F * at the time to the given Restart instance's * originalF member data * * @return unused */ public int doTransition() throws InvalidVariableValueException, RelationNumberOutOfBoundsException, RankOutOfBoundsException, InvalidVariableNamesLengthException, VariablePositionOutOfBoundsException{ M.reset(); return -1; } }