aima.core.learning.framework.NumericAttribute Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aima-core Show documentation
Show all versions of aima-core Show documentation
AIMA-Java Core Algorithms from the book Artificial Intelligence a Modern Approach 3rd Ed.
The newest version!
package aima.core.learning.framework;
/**
* @author Ravi Mohan
*
*/
public class NumericAttribute implements Attribute {
double value;
private NumericAttributeSpecification spec;
public NumericAttribute(double rawValue, NumericAttributeSpecification spec) {
this.value = rawValue;
this.spec = spec;
}
public String valueAsString() {
return Double.toString(value);
}
public String name() {
return spec.getAttributeName().trim();
}
public double valueAsDouble() {
return value;
}
}