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

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

public class CSPVariable
extends Variable<CSPVariable,CSPValue>

CSP variable.

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

Version:
IFS 1.2 (Iterative Forward Search)
Copyright (C) 2006 - 2010 Tomas Muller
muller@unitime.org
http://muller.unitime.org

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 3 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 see http://www.gnu.org/licenses/.

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<CSPVariable,CSPValue>


Copyright © 2014 UniTime LLC. All Rights Reserved.