org.cpsolver.ifs.example.csp

## Class CSPValue

- java.lang.Object
- - org.cpsolver.ifs.model.Value<CSPVariable,CSPValue>
  - - org.cpsolver.ifs.example.csp.CSPValue

- All Implemented Interfaces:
    Comparable<CSPValue>, AssignmentComparable<CSPValue,CSPVariable,CSPValue>

      public class CSPValue
      extends Value<CSPVariable,CSPValue>

  CSP value.
  Version:
    IFS 1.3 (Iterative Forward Search)
    Copyright (C) 2006 - 2014 Tomáš Müller
    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/.
  Author:
    Tomáš Müller

- - ### Field Summary

    - ### Fields inherited from class org.cpsolver.ifs.model.Value

      `iValue`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CSPValue(CSPVariable variable, int value)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getName()` Values name -- for printing purposes (E.g., Monday 7:30)
    `double` | `toDouble()` Double representation.

    - ### Methods inherited from class org.cpsolver.ifs.model.Value

      `compareTo, compareTo, conflicts, conflicts, equals, getDescription, getExtra, getId, hashCode, isConsistent, setExtra, setVariable, toDouble, toString, valueEquals, valueEquals, variable`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### CSPValue

          public CSPValue(CSPVariable variable,
                          int value)

      Constructor
      Parameters:
        `variable` - parent variable
        `value` - value (an integer between 0 .. number of values - 1 )

  - ### Method Detail

    - #### toDouble

          public double toDouble()

      Description copied from class: `Value`
      Double representation. This allows us to have generic optimization criteria. The task is than to minimize total value of assigned variables of a solution. If the value may depend on other values of the assignment, use `Value.toDouble(Assignment)` instead.
      Overrides:
        `toDouble` in class `Value<CSPVariable,CSPValue>`
      Returns:
        this value's contribution to the solution value

    - #### getName

          public String getName()

      Description copied from class: `Value`
      Values name -- for printing purposes (E.g., Monday 7:30)
      Overrides:
        `getName` in class `Value<CSPVariable,CSPValue>`
      Returns:
        value name