Menu

Use DecisionTable and pass it to a vector of DecisionRule

transform a String matrix [ ][ ] to DecisionTable

/**
 * Gets the rules test.
 * @author: Yan Tang, VUB, 2009
 * @return the rules test
 */
public static void getRulesTest() {
    String[][] content = new String[][] { { "CONDITION", "", "", "", "" },
            { "C1", "Y", "N", "Y", "N" }, { "C2", "Y", "Y", "N", "N" },
            { "ACTION", "", "", "", "" }, { "A1", "/", "*", "/", "/" },
            { "A2", "*", "*", "/", "/" } };
    DecisionTable table = new DecisionTable();
    Vector<DecisionRule> rules = table.getRules(content);
    for (int i = 0; i < rules.size(); i++)
        rules.get(i).printToConsole();
}
Posted by Yan Tang Demey 2013-03-11

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.