fipaos.skill.constraint.ccl.object
Class CSP


public class CSP


This class represents a CSP Object as described in the
"CCL Language specification v2.01" section 4.1.1.1, p5.

A CSP object represents a choice problem.
For a CSP object to be well defined, the items in the Exclusion and Relations
slots must only refer to variables which are present in the Variables slot.
7/3/00


Field Summary
 final static intCONTENT
           
 final static StringCSP
          String used to reference a CSP object when represented as a Content object.
 final static StringCSPEXCLUSION
          String CSP-exclusion objects are always referenced with when stored in Content objects.
 final static StringCSPREF
          String used to reference the variable containing the name of the CSP.
 final static StringCSPRELATION
          String CSP-relation objects are always referenced with when stored in Content objects.
 final static StringCSPVARIABLE
          String CSP-variable objects are always referenced with when stored in Content objects.
 final static intLIST
           
 final static intLONG
           
 final static intSTRING
           

Constructor Summary
CSP()
          
Constructs an empty CSP object.
CSP(Content content)
          
Constructs a new CSP object.

Method Summary
 voidaddRelationship(CSPRelation relation)
          
Adds a new CSPRelation.
 voidaddVariable(CSPVariable variable)
          Adds a Variable to the CSP.
 CSPcopy()
          Returns a copy of this CSP.
 VectorgetRelations()
          Returns a Vector of all the Relations contained in the CSP.
 VectorgetVariables()
          Retrieves a Vector of all the variables in this CSP.
 voididentify(String str)
          Adds a unique name with which to identify this CSP.
 Stringidentity()
          Returns the identifier to this CSP.
 static voidmain(String[] args)
          
With no variables the main method constructs and tests a CSP object.
 ContenttoContent()
          
Returns a Content object populated with Data representing the information
held in this CSP object.
 StringtoString()
          Returns a String representation of the CSP.

Field Detail

CONTENT

public final static int CONTENT

CSP

public final static String CSP
String used to reference a CSP object when represented as a Content object.

CSPEXCLUSION

public final static String CSPEXCLUSION
String CSP-exclusion objects are always referenced with when stored in Content objects.

CSPREF

public final static String CSPREF
String used to reference the variable containing the name of the CSP.

CSPRELATION

public final static String CSPRELATION
String CSP-relation objects are always referenced with when stored in Content objects.

CSPVARIABLE

public final static String CSPVARIABLE
String CSP-variable objects are always referenced with when stored in Content objects.

LIST

public final static int LIST

LONG

public final static int LONG

STRING

public final static int STRING
Constructor Detail

CSP

public CSP()

Constructs an empty CSP object.
This will then be ready to be populated so it represents a
Constraint Satisfaction Problem.

CSP

public CSP(Content content)

Constructs a new CSP object.
This will then be populated using the Data passed in the Content object.
Method Detail

addRelationship

public void addRelationship(CSPRelation relation)

Adds a new CSPRelation.
This identifies a relationship between variables in this CSP.

addVariable

public void addVariable(CSPVariable variable)
Adds a Variable to the CSP.

copy

public CSP copy()
Returns a copy of this CSP.

getRelations

public Vector getRelations()
Returns a Vector of all the Relations contained in the CSP.

getVariables

public Vector getVariables()
Retrieves a Vector of all the variables in this CSP.

identify

public void identify(String str)
Adds a unique name with which to identify this CSP.

identity

public String identity()
Returns the identifier to this CSP.

main

public static void main(String[] args)

With no variables the main method constructs and tests a CSP object.
If a String is specified as a command line argument it will read it in,
parse it and try to form a CSP object using a Content object.

toContent

public Content toContent()

Returns a Content object populated with Data representing the information
held in this CSP object.

toString

public String toString()
Returns a String representation of the CSP.

Association Links

to Class java.lang.String

String CSP-variable objects are always referenced with when stored in Content objects.

to Class java.lang.String

String CSP-relation objects are always referenced with when stored in Content objects.

to Class java.lang.String

String CSP-exclusion objects are always referenced with when stored in Content objects.

to Class java.lang.String

String used to reference the variable containing the name of the CSP.

to Class java.lang.String

String used to reference a CSP object when represented as a Content object.

to Class java.lang.String


The reference to this CSP object.
This represents the information held in a CSP-identifier object.
This is the unique name of the CSP.

to Class java.util.Vector


This Vector represents the choices which need to be taken in the choice
problem. The variables listed in this slot must all have unique names.

This Vector contains a set of CSPVariable objects.

to Class java.util.Vector


This Vector represents the relationships between the choices to be made.

This Vector contains a set of CSPRelation objects.

to Class java.util.Vector


This Vector represents a list of unary relations on single variables
which exclude certain values from variable domains.

This Vector contains a set of CSPExclusion objects.