/* * CSP Project * Authors: * Jay Bernardo * Matt Rancourt * * File: TransitionAssignmentVariable.java * * Contains the TransitionAssignmentVariable class. * This class is simply extends the basic Variable, but with * extra information to decide whether its a decision variable or not * */ class TransitionAssignmentVariable extends AbstractVariable{ boolean decided; /** * Basic Constructor * * @param name - variable name * @param value - value to assign to the variable name * @param positive - whether the variable is positive or negative * @param decided - whether the variable is decided or not * @throws InvalidVariableValueException */ public TransitionAssignmentVariable(String name, int value, boolean positive, boolean decided) throws InvalidVariableValueException{ super(name, value, positive); this.positive = true; this.decided = decided; } /** * Returns whether the given variable is a decided variable or not * @return - true if the variable is decided * - false otherwise */ public boolean decided(){ return decided; } /** * Prints the variable in a pretty format */ public void print(){ if(value == 0){ System.out.print("!"); } System.out.print(name); if(decided){ System.out.print("*"); } } }