fipaos.skill.constraint.ccl.object
Class CSPSolution


public class CSPSolution


This class represents as CSP-solution Object as described in the
"CCL Language Specification v2.01" section 4.1.1.2, p5.

This object captures the notion of a solution to a choice problem.
Here all the choices are assigned an appropriate value and the
assignment violates none of the posted constraints.


Field Summary
 final static intCONTENT
           
 final static StringCSPSOLUTION
          String used to reference a Content object representing a CSPSolution object
 final static StringCSPVARIABLEASSIGNMENT
          String used to reference a Content object representing a CSPVariableAssignment object.
 final static StringHREF
          
String used to reference the identifier of a CSPSolution object when represented
as an Attribute of a Content object.
 final static intLIST
           
 final static intLONG
           
 final static intSTRING
           

Constructor Summary
CSPSolution()
          Constructs an empty CSPSolution
CSPSolution(String name)
          
Constructs a CSPSolution with the given name.
CSPSolution(Content content)
          Constructs a new CSPSolution and populates it with the Data in the passed Content object.

Method Summary
 voidaddVariable(CSPVariableAssignment var)
          
Adds a new Variable Assignment to the CSPSolution
This represents another element in the solution.
 CSPSolutioncopy()
          Returns a copy of the CSPSolution object.
 voididentify(String str)
          
Identifies the CSPSolution.
 Stringidentity()
          
Returns the identifier for the CSPSolution.
 static voidmain(String[] args)
          Used for testing the class.
 ContenttoContent()
          Returns a Content object populated with the Data held in this CSPSolution object.
 StringtoString()
          Returns a String representation of the CSPSolution.
 Vectorvariables()
          
Returns a Vector containing all the Variable Assignments that
represent the solution to the CSP problem.

Field Detail

CONTENT

public final static int CONTENT

CSPSOLUTION

public final static String CSPSOLUTION
String used to reference a Content object representing a CSPSolution object

CSPVARIABLEASSIGNMENT

public final static String CSPVARIABLEASSIGNMENT
String used to reference a Content object representing a CSPVariableAssignment object.

HREF

public final static String HREF

String used to reference the identifier of a CSPSolution object when represented
as an Attribute of a Content object.

LIST

public final static int LIST

LONG

public final static int LONG

STRING

public final static int STRING
Constructor Detail

CSPSolution

public CSPSolution()
Constructs an empty CSPSolution

CSPSolution

public CSPSolution(String name)

Constructs a CSPSolution with the given name.
This name refers to the CSP this is the solution for.

CSPSolution

public CSPSolution(Content content)
Constructs a new CSPSolution and populates it with the Data in the passed Content object.
Method Detail

addVariable

public void addVariable(CSPVariableAssignment var)

Adds a new Variable Assignment to the CSPSolution
This represents another element in the solution.

copy

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

identify

public void identify(String str)

Identifies the CSPSolution.
This name refers to the CSP it is a solution for.

identity

public String identity()

Returns the identifier for the CSPSolution.
This name refers to the CSP it is a solution for.

main

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

toContent

public Content toContent()
Returns a Content object populated with the Data held in this CSPSolution object.

toString

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

variables

public Vector variables()

Returns a Vector containing all the Variable Assignments that
represent the solution to the CSP problem.

Association Links

to Class java.lang.String

String used to reference a Content object representing a CSPSolution object

to Class java.lang.String

String used to reference a Content object representing a CSPVariableAssignment object.

to Class java.lang.String


String used to reference the identifier of a CSPSolution object when represented
as an Attribute of a Content object.

to Class java.lang.String

This references the CSP object this object is a solution for.

to Class java.util.Vector


This Vector contains a list of CSPVariable-Assignment objects.
These are the solution to the CSP object that that CSP-identifier
referrs to.

This list of variable assignments is such that:

The list contains one and only one assignment for each and every
variable defined in the CSP.

The assignment of these values violates none of the constraints
posted for the CSP. That is the variable assignment is consistent.