net.sf.cpsolver.ifs.example.csp
Class CSPVariable

java.lang.Object
  extended by net.sf.cpsolver.ifs.model.Variable
      extended by net.sf.cpsolver.ifs.example.csp.CSPVariable
All Implemented Interfaces:
Comparable

public class CSPVariable
extends Variable

CSP variable.

This class only implements generation of variable's values (domain)

Version:
IFS 1.1 (Iterative Forward Search)
Copyright (C) 2006 Tomáš Müller
muller@unitime.org
Lazenska 391, 76314 Zlin, Czech Republic

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Field Summary
 
Fields inherited from class net.sf.cpsolver.ifs.model.Variable
iId, iValue
 
Constructor Summary
CSPVariable(int id, int domainSize)
          Constructor
CSPVariable(int id, int domainSize, int kernelId)
          Constructor
 
Method Summary
 void generateInitialValue(Random rnd)
          Generate an intial value (for MPP and for forcing of existance of a solution)
 int getKernelId()
          Get kernel id
 String getName()
          Variable's name -- for printing purposes
 
Methods inherited from class net.sf.cpsolver.ifs.model.Variable
addContstraint, addVariableListener, assign, compareTo, constraints, constraintVariables, countAssignments, equals, getAssignment, getBestAssignment, getBestAssignmentIteration, getDescription, getExtra, getId, getInitialAssignment, getModel, getVariableListeners, hardConstraints, hasAssignment, hashCode, hasInitialAssignment, hasValues, lastAssignmentIteration, lastUnassignmentIteration, removeContstraint, removeInitialValue, removeValue, removeVariableListener, setBestAssignment, setExtra, setInitialAssignment, setModel, setValues, softConstraints, toString, unassign, values
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CSPVariable

public CSPVariable(int id,
                   int domainSize)
Constructor

Parameters:
domainSize - number of values of the variable

CSPVariable

public CSPVariable(int id,
                   int domainSize,
                   int kernelId)
Constructor

Parameters:
domainSize - number of values of the variable
kernelId - kernel id (for structured CSP)
Method Detail

getKernelId

public int getKernelId()
Get kernel id


generateInitialValue

public void generateInitialValue(Random rnd)
Generate an intial value (for MPP and for forcing of existance of a solution)


getName

public String getName()
Description copied from class: Variable
Variable's name -- for printing purposes

Overrides:
getName in class Variable