public class Attribute
extends java.lang.Object
Implements DEXi attribute, which is defined by:
Constructor and Description |
---|
Attribute(org.w3c.dom.Element element,
int attLevel)
Constructor with element parameter.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributes(java.util.ArrayList<Attribute> aList)
Add attribute subtree to a list of attributes.
|
boolean |
affects(Attribute att)
Tells whether this attribute affects another attribute.
|
int |
argsToIndex(int[] args)
Converts an integer array of function argument values to rule index
|
java.lang.Integer |
compareArgs(int[] args1,
int[] args2)
Compare argument arrays.
|
java.lang.Integer |
compareRules(int r1,
int r2)
Compare arguments of rules indexed by r1 and r2
|
boolean |
depends(Attribute att)
Tells whether this attribute depends on another attribute.
|
void |
evaluate()
Fast evaluation of this.attribute and its descendants.
|
void |
evaluate(Model.Evaluation evalType,
boolean normalize)
Full evaluation of this.attribute and its descendants.
|
Value |
evaluate(VariableList variableList)
Deprecated.
|
boolean |
functionIsConsistent()
Tests whether the entire function is consistent.
|
Rule |
functionValue(int[] args)
Calculate function value with respect to args[].
|
Attribute |
getAttribute(int index)
Get index-th child attribute.
|
int |
getAttributeCount()
Get the number of child attributes of this attribute.
|
java.lang.Boolean |
getCompleteness()
Get completeness.
|
java.lang.String |
getDescription()
Get description.
|
Distribution |
getDistr()
Get value distribution.
|
java.lang.Boolean |
getExplicitness()
Get explicitness.
|
java.lang.String |
getFunctionString()
Represent function with a string.
|
int |
getInputs()
Number of this.attribute's immediate descendants.
|
int |
getLevel()
Get attribute level in the tree.
|
Attribute |
getLink()
Get linked attribute.
|
java.lang.String |
getName()
Get attribute name.
|
Rule |
getRule(int index)
Get index-th rule of the function attached to this attribute.
|
int |
getRuleCount()
Get the number of rules contained in the function attached to this
attribute.
|
int |
getScaleCount()
Get the size of the scale attached to this attribute.
|
java.lang.Integer |
getScaleSize()
Get scale size.
|
java.lang.String |
getScaleValue(int index)
Get the name of index-th value of the scale attached to this attribute.
|
Value |
getValue()
Get single attribute value.
|
int[] |
indexToArgs(int index)
Converts rule index to corresponding function argument values
|
void |
linkAttribute(java.util.ArrayList<Attribute> aList)
Try to link this.attribute and all its descendants with candidate
attributes in a list.
|
void |
prepareInputDistribution(Model.Evaluation evalType,
boolean normalize)
Prepare input value distribution of this.attribute (before evaluation).
|
void |
prepareOutputDistribution(Model.Evaluation evalType,
boolean normalize)
Process output value distribution of this.attribute (after evaluation).
|
void |
print(java.io.OutputStream stream)
Print object values to OutputStream.
|
Rule |
ruleBounds(int x)
Calculates lower and higher bounds for x-th rule.
|
boolean |
ruleIsConsistent(int x)
Tests whether rule x is consistent according to the dominance principle.
|
boolean |
ruleIsConsistent(int x,
Rule bounds)
Tests whether rule x is consistent with respect to bounds.
|
void |
setFunctionString(java.lang.String fnc)
Set function from String.
|
public Attribute(org.w3c.dom.Element element, int attLevel)
element
- XML object parameter.public void addAttributes(java.util.ArrayList<Attribute> aList)
aList
- ArrayListpublic boolean affects(Attribute att)
att
- Another attributepublic boolean depends(Attribute att)
att
- Another attributepublic void linkAttribute(java.util.ArrayList<Attribute> aList)
aList
- List of attributes.public Value evaluate(VariableList variableList)
variableList
- VariableList object parameterpublic void evaluate()
public void evaluate(Model.Evaluation evalType, boolean normalize)
evalType
- Evaluation type.normalize
- If true, normalize results after evaluation.public void prepareInputDistribution(Model.Evaluation evalType, boolean normalize)
evalType
- normalize
- public void prepareOutputDistribution(Model.Evaluation evalType, boolean normalize)
evalType
- normalize
- public java.lang.String getName()
public java.lang.String getDescription()
public java.lang.Boolean getExplicitness()
public java.lang.Boolean getCompleteness()
public int getLevel()
public java.lang.Integer getScaleSize()
public Value getValue()
public Distribution getDistr()
public Attribute getLink()
public int getInputs()
public int argsToIndex(int[] args)
args
- Argument valuespublic int[] indexToArgs(int index)
index
- Rule index.public Rule functionValue(int[] args)
args
- Function arguments - ordinal numbers.public int getAttributeCount()
public Attribute getAttribute(int index)
index
- public int getScaleCount()
public java.lang.String getScaleValue(int index)
index
- public int getRuleCount()
public Rule getRule(int index)
index
- public java.lang.Integer compareArgs(int[] args1, int[] args2)
args1
- args2
- public java.lang.Integer compareRules(int r1, int r2)
r1
- r2
- public Rule ruleBounds(int x)
x
- Rule indexpublic boolean ruleIsConsistent(int x, Rule bounds)
x
- Rule indexbounds
- Lower and higher bounds for the values.public boolean ruleIsConsistent(int x)
x
- Rule indexpublic boolean functionIsConsistent()
public java.lang.String getFunctionString()
public void setFunctionString(java.lang.String fnc)
fnc
- String that should be in the same format as the one produced
by getFunctionString().public void print(java.io.OutputStream stream) throws java.io.IOException
stream
- OutputStream object parameter.java.io.IOException
- Throws exception if stream cannot write.