fipaos.skill.constraint.ccl.constraint
Class CSPRelation


public class CSPRelation


This class represents the object "CSP-relation" as described in the document

"CCL Language Specification v2.01" section 4.2.3.2, p14.



This object represents a relation between two variables. Any varibles named

in the Relation-body must appear in the set of Varibles of the relation.

The set of index-pairs identifies which slots in a tuple valued variable are

covered by the relation. For example, for an equality relation between two

variables with 3 tuples as values (e.g. (x, y, z)), setting the set of indices

to {(2,2), (3,3)} indicates that only the 2nd and 3rd slot of the value tuples

need ever be equal- the constraint is not violated even if the values in the

1st slots are unequal.


Field Summary
 final static StringCSPRELATION
          String that a CSPRelation will be referenced with when represented as a Content object.
 final static StringEMPTY
          
This specifies that there are no allowed combinations of values for these variables.
 final static StringEQUALITY
          
This specifies that all the variables listed in the Variables list of the

relevant CSP-constraint object must take equal values in any instantiation.
 final static StringGREATER_THAN
          
This specifies that the variables in the Variables list of the relevant

CSP-constraint object are related by a "greater than" relationship ">" such

that the order of the tuple defines the order in the relationship- the first

variable in the list is strictly greater than the second, which is strictly

greater than the third etc.
 final static StringGREATER_THAN_EQUAL
          
Similar to greaterThan described above but using a "greater than or equals" relation.
 final static StringINDICES
          
String that a Set of Indices will be referenced with when represented as an Attribute

of a Content object.
 final static StringINEQUALITY
          
This specifies that all the variables list in the Variables list of the

relevant CSP-constraint object must take strictly different values in any

instantiation.
 final static StringLESS_THAN
          
This specifies that the variables in the Variables list of the relevant

CSP-constraint object are related by a "less than" relationship "<" such that

that order of the tuple defines the order in the relationship- the first variable

in the list is strictly less than the second, which is strictly less than the

third, etc.
 final static StringLESS_THAN_EQUAL
          
Similar to lessThan described above but using a "less than or equals" relation.
 final static StringNAME
          The only Attribute stored in a Content object representing "Tags" information.
 final static StringRELATION_TYPE
          
String that the relation type is referenced with when represented as an Attribute of

of a Content object.
 final static StringTAGS
          
String that a collection of tags is referenced with when represented as an Attribute

of a Content object.
 final static StringVARIABLES
          
String that a set of variables are referenced with when represented as an Attribute

of a Content object.

Constructor Summary
CSPRelation()
          Constructs an empty CSPRelation object.
CSPRelation(Content content)
          
Constructs a new CSPRelation object and populates it with the data

passed in the content object

Method Summary
 voidaddIndexPair(IndexPair indices)
          Adds a new IndexPair.
 voidaddTag(String str)
          Adds a new Tag.
 CSPRelationcopy()
          Returns a copy of the CSPRelation object.
 VectorgetIndexPairs()
          Returns a Vector of the IndexPairs stored in the CSPRelation.
 StringgetRelationType()
          
Returns a String indicating the relationship between the two variables

this CSPRelation concerns.
 VectorgetTags()
          Returns a Vector of the Tags stored in the CSPRelation.
 StringgetVariableNameOne()
          Returns the name of the first variable this CSPRelation concerns.
 StringgetVariableNameTwo()
          Returns the name of the second variable this CSPRelation concerns.
 static voidmain(String[] args)
          Used for testing.
 voidsetRelationType(String str)
          
Sets the nature of the relationship between the two variables this

CSPRelation concerns.
 voidsetVariableNameOne(String str)
          Sets a value for the first variable this CSPRelation concerns.
 voidsetVariableNameTwo(String str)
          Sets a value for the second variable this CSPRelation concerns.
 ContenttoContent()
          Returns a Content object representing this class populated with the Data it contains.
 StringtoString()
          Returns a String representation of the CSPRelation object.

Field Detail

CSPRELATION

public final static String CSPRELATION
String that a CSPRelation will be referenced with when represented as a Content object.

EMPTY

public final static String EMPTY

This specifies that there are no allowed combinations of values for these variables.

EQUALITY

public final static String EQUALITY

This specifies that all the variables listed in the Variables list of the

relevant CSP-constraint object must take equal values in any instantiation.

GREATER_THAN

public final static String GREATER_THAN

This specifies that the variables in the Variables list of the relevant

CSP-constraint object are related by a "greater than" relationship ">" such

that the order of the tuple defines the order in the relationship- the first

variable in the list is strictly greater than the second, which is strictly

greater than the third etc.



This relation is only valid for variable types which have an ordering relation

defined in the domain ontology.

GREATER_THAN_EQUAL

public final static String GREATER_THAN_EQUAL

Similar to greaterThan described above but using a "greater than or equals" relation.

INDICES

public final static String INDICES

String that a Set of Indices will be referenced with when represented as an Attribute

of a Content object.

INEQUALITY

public final static String INEQUALITY

This specifies that all the variables list in the Variables list of the

relevant CSP-constraint object must take strictly different values in any

instantiation.

LESS_THAN

public final static String LESS_THAN

This specifies that the variables in the Variables list of the relevant

CSP-constraint object are related by a "less than" relationship "<" such that

that order of the tuple defines the order in the relationship- the first variable

in the list is strictly less than the second, which is strictly less than the

third, etc.



This relation is only valid for variable types which have an ordering relation

defined in the domain ontology.

LESS_THAN_EQUAL

public final static String LESS_THAN_EQUAL

Similar to lessThan described above but using a "less than or equals" relation.

NAME

public final static String NAME
The only Attribute stored in a Content object representing "Tags" information.

RELATION_TYPE

public final static String RELATION_TYPE

String that the relation type is referenced with when represented as an Attribute of

of a Content object.

TAGS

public final static String TAGS

String that a collection of tags is referenced with when represented as an Attribute

of a Content object.

VARIABLES

public final static String VARIABLES

String that a set of variables are referenced with when represented as an Attribute

of a Content object.
Constructor Detail

CSPRelation

public CSPRelation()
Constructs an empty CSPRelation object.

CSPRelation

public CSPRelation(Content content)

Constructs a new CSPRelation object and populates it with the data

passed in the content object
Method Detail

addIndexPair

public void addIndexPair(IndexPair indices)
Adds a new IndexPair.

addTag

public void addTag(String str)
Adds a new Tag.

copy

public CSPRelation copy()
Returns a copy of the CSPRelation object.

getIndexPairs

public Vector getIndexPairs()
Returns a Vector of the IndexPairs stored in the CSPRelation.

getRelationType

public String getRelationType()

Returns a String indicating the relationship between the two variables

this CSPRelation concerns.

getTags

public Vector getTags()
Returns a Vector of the Tags stored in the CSPRelation.

getVariableNameOne

public String getVariableNameOne()
Returns the name of the first variable this CSPRelation concerns.

getVariableNameTwo

public String getVariableNameTwo()
Returns the name of the second variable this CSPRelation concerns.

main

public static void main(String[] args)
Used for testing.

setRelationType

public void setRelationType(String str)

Sets the nature of the relationship between the two variables this

CSPRelation concerns.

Should be set using the constants this class provides.

setVariableNameOne

public void setVariableNameOne(String str)
Sets a value for the first variable this CSPRelation concerns.

setVariableNameTwo

public void setVariableNameTwo(String str)
Sets a value for the second variable this CSPRelation concerns.

toContent

public Content toContent()
Returns a Content object representing this class populated with the Data it contains.

toString

public String toString()
Returns a String representation of the CSPRelation object.

Association Links

to Class java.lang.String


This specifies that all the variables listed in the Variables list of the

relevant CSP-constraint object must take equal values in any instantiation.

to Class java.lang.String


This specifies that all the variables list in the Variables list of the

relevant CSP-constraint object must take strictly different values in any

instantiation.

to Class java.lang.String


This specifies that the variables in the Variables list of the relevant

CSP-constraint object are related by a "greater than" relationship ">" such

that the order of the tuple defines the order in the relationship- the first

variable in the list is strictly greater than the second, which is strictly

greater than the third etc.



This relation is only valid for variable types which have an ordering relation

defined in the domain ontology.

to Class java.lang.String


This specifies that the variables in the Variables list of the relevant

CSP-constraint object are related by a "less than" relationship "<" such that

that order of the tuple defines the order in the relationship- the first variable

in the list is strictly less than the second, which is strictly less than the

third, etc.



This relation is only valid for variable types which have an ordering relation

defined in the domain ontology.

to Class java.lang.String


Similar to greaterThan described above but using a "greater than or equals" relation.

to Class java.lang.String


Similar to lessThan described above but using a "less than or equals" relation.

to Class java.lang.String


This specifies that there are no allowed combinations of values for these variables.

to Class java.lang.String

String that a CSPRelation will be referenced with when represented as a Content object.

to Class java.lang.String


String that a Set of Indices will be referenced with when represented as an Attribute

of a Content object.

to Class java.lang.String


String that the relation type is referenced with when represented as an Attribute of

of a Content object.

to Class java.lang.String


String that a collection of tags is referenced with when represented as an Attribute

of a Content object.

to Class java.lang.String

The only Attribute stored in a Content object representing "Tags" information.

to Class java.lang.String


String that a set of variables are referenced with when represented as an Attribute

of a Content object.

to Class java.lang.String

Name of first CSP-variable in the relation.

to Class java.lang.String

Name of second CSP-variable in the relation.

to Class java.lang.String

The relation type between these two variables

to Class java.util.Vector


Indices.

Specifies what sub-fields of variable values the relation refers to.

This is a Vector of IndexPair objects.

to Class java.util.Vector

Contains a list of symbols that allow selective constraints.