package infosapient.system;
import infosapient.system.FzyKnowledgebase;
import infosapient.system.FSEvent;
import infosapient.system.FzySystemException;
/**
* Class FzyUnconditionalRule implements the behavior of an <i> UNCONDITIONAL</i> rule.
* An unconditional rule is a rule that has no conditions to be met; it is always fired.
*
* <blockquote> Examples of Unconditional Rules:
* <li> Our Profits should be high.</li>
* <li> Our Price should be high.</li>
* <li> Our Price should be low.</li>
* <li> Our Price should be 2 * ManufacturingCosts.</li>
* <li> Our Price should be near CompetitionPrice. </li>
* </blockquote>
* Unconditional rules are extremely useful in resolving contradictory evidence or rules.
* @author: Copyright (c) 2001, Workplace Performance Tools, All Rights Reserved.
* License to use this program is provided under the COMMON PUBLIC LICENSE 0.5
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE
* ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
* @version $Revision: 1.1.1.1 $
*/
public class FzyUnconditionalRule extends FzyRule {
static final long serialVersionUID = 4075229390068657420L;
public FzyUnconditionalRule() {
super();
}
public FzyUnconditionalRule(FzyKnowledgebase kb) {
super(kb);
}
public FzyRule addConsequent(FzyConsequent fc) {
try {
throw new FzySystemException(this +
" Consequents may NOT be given to an Unconditional Rule");
} catch (FzySystemException fse) {
notifyObservers(new FSEvent(this, "Error", fse));
}
return this;
}
}