//****************************************************************************** // This component produced by Rough Enough version 4.0 // utilizing Object Mining technology introduced by Anders Torvill Bjorvand //****************************************************************************** // Rough Enough is (C)opyright of Troll Data Inc in Norway which can be // reached at email: support@trolldata.no // www: http://www.trolldata.com/ //****************************************************************************** // Rules-method:1: Voting with inexact rules //****************************************************************************** // Time of generation: 05:10:32 PM, 08/24/98 //****************************************************************************** public class dogs implements java.io.Serializable { // Property declarations protected int AttributeDecision = 0; protected int AttributeTail = 0; protected int AttributeHair = 0; private int decisionPower = -1; private int decisionIndex = -1; private int[] predictions; private boolean match; // Ruleset private int ruleSetSize = 6; private int numberOfConditionalAttributes = 2; private int numberOfDecisionValues = 4; protected int[][] ruleSet = { {-1, 2, 4, 1, 0}, {-1, 3, 3, 1, 0}, {1, 1, 1, 1, 0}, {1, 3, 3, 1, 0}, {2, 1, 2, 1, 0}, {2, 2, 4, 1, 0}, }; // Constructor public dogs() { } protected void calculateDecision() { decisionPower = -1; decisionIndex = -1; predictions = new int[numberOfDecisionValues]; for(int i = 0; i decisionPower) { decisionPower = predictions[i-1]; decisionIndex = i; } } if(decisionIndex == -1) { AttributeDecision = 0; } else { AttributeDecision = decisionIndex; } } public void setAttributeTail(int attribute_value) { AttributeTail = attribute_value; } public int getAttributeTail() { return AttributeTail; } public void setAttributeHair(int attribute_value) { AttributeHair = attribute_value; } public int getAttributeHair() { return AttributeHair; } private int getAttributeByIndex(int attributeIndex) { switch(attributeIndex) { case 1: { return getAttributeTail(); } case 2: { return getAttributeHair(); } default: { return -1; } } } public int getAttributeDecision() { calculateDecision(); return AttributeDecision; } }