public class Attribute
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Attribute.AttributeType
And enumeration type to indicate the various types of attributes supported.
|
Modifier and Type | Field and Description |
---|---|
java.util.List<java.lang.String> |
discValues
The possible categorical values for a discrete or boolean attribute.
|
java.util.Map<java.lang.String,java.lang.Integer> |
discValuesHash
maps categorical names of discrete values to int values
|
Domain |
domain
domain that holds this attribute
|
boolean |
hidden
whether this value is part of the state representation or is hidden from the agent
|
double |
lowerLim
lowest value for a non-relational attribute
|
java.lang.String |
name
name of the attribute
|
Attribute.AttributeType |
type
type of values attribute holds
|
double |
upperLim
highest value for a non-relational attribute
|
Constructor and Description |
---|
Attribute(Domain domain,
java.lang.String name)
Constructs an attribute with an unspecified type that will need to be specified later.
|
Attribute(Domain domain,
java.lang.String name,
Attribute.AttributeType type)
Constructs with a given attribute type.
|
Modifier and Type | Method and Description |
---|---|
Attribute |
copy(Domain newDomain)
Will create a new Attribute object with the same configuration and name as this one.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
void |
setDiscValues(java.util.List<java.lang.String> vals)
Sets a discrete attribute's categorical values
|
void |
setDiscValues(java.lang.String[] vals)
Sets a discrete attribute's categorical values.
|
void |
setDiscValuesForRange(int low,
int high,
int step)
Sets the possible range of discrete (@link
Attribute.AttributeType.DISC ) values for the attribute. |
void |
setLims(double lower,
double upper)
Sets the upper and lower bound limits for a bounded real attribute.
|
void |
setType(Attribute.AttributeType type)
Sets the type for this attribute.
|
Value |
valueConstructor()
Returns a Value object compatible with this Attributes type (i.e., discrete or real).
|
public java.lang.String name
public Attribute.AttributeType type
public Domain domain
public double lowerLim
public double upperLim
public java.util.Map<java.lang.String,java.lang.Integer> discValuesHash
public java.util.List<java.lang.String> discValues
public boolean hidden
public Attribute(Domain domain, java.lang.String name)
domain
- the domain that the attribute exists inname
- the name of the attributepublic Attribute(Domain domain, java.lang.String name, Attribute.AttributeType type)
domain
- the domain that the attribute exists inname
- the name of the attributetype
- the type of the attribute (discrete or real)public Attribute copy(Domain newDomain)
newDomain
- the domain to which the new attribute should be attachedpublic void setLims(double lower, double upper)
lower
- the lower limitupper
- the upper limitpublic void setType(Attribute.AttributeType type)
type
- the attribute type to which this attribute should be setpublic void setDiscValues(java.util.List<java.lang.String> vals)
vals
- the list of categorical values for this discrete attributepublic void setDiscValues(java.lang.String[] vals)
vals
- an array of categorical values for this discerte attributepublic void setDiscValuesForRange(int low, int high, int step)
Attribute.AttributeType.DISC
) values for the attribute. The categorical values
will be set to the the string representation of each integer number.low
- the minimum int value for the attributehigh
- the maximum int value for the attributestep
- the amount by which the int value will increasepublic Value valueConstructor()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object