Menu

JDecisiontableLib-1.0-RC-3

There is a new release candidate because I made a change and a improvement. Both affects the class Rule.

Change: While playing with JDecisiontable application http://sourceforge.net/projects/jdecisiontable (which uses this library) I found that one would create invalid decision tables while using Rule.setLastYesToNo(). Use Case (RC-2):

1234
YYYY
Y**N**NN
-YY**N**
-Y**N**N



Bold are the N wich are replaced by Rule.setLastYesToNo(). All rules are correct as such. But the decision table is invalid because there is one rule missing in rule 4. Lets fix this by replacing the last Decison.No (N) by a Decison.DontCare (-):

1234
YYYY
Y**N**NN
-YY**N**
-Y**N**-



And exactly this is the change for Rule.setLastYesToNo() in RC-3: If the algorithm finds a Decision.Yes it replaces the last Decision.Yes by a Decision.No (the bold) letters and than it replaces all decisons below by a Decison.Dontcare as we did with rule 4. Now it is users turn to overwrite the Decison.Dontcare if neccessary.

Improvement: The constructor of class rule throws an exception if the number of nodes is less than one. The CERT Oracle Secure Coding Standard for Java says to be wary of it so I mada a private function and a private constructor as shown here https://www.securecoding.cert.org/confluence/display/java/OBJ11-J.+Be+wary+of+letting+constructors+throw+exceptions. This improvement doesn't affect the operation of the class.

Posted by Michael Groß 2012-03-22

Log in to post a comment.