net.sf.cpsolver.ifs.multi
Class MultiValue

java.lang.Object
  extended by net.sf.cpsolver.ifs.model.Value
      extended by net.sf.cpsolver.ifs.multi.MultiValue
All Implemented Interfaces:
Comparable

public class MultiValue
extends Value

A value of MultiVariable. Such value contains a value for every "normal" variable of MultiVariable.

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.Value
iValue
 
Constructor Summary
MultiValue(MultiVariable variable, Value[] values)
          Constructor
MultiValue(MultiVariable variable, Value[] values, Double doubleValue, boolean correctOrder)
          Constructor
 
Method Summary
 Object clone()
           
 boolean equals(Object o)
          By default, comparison is made on unique ids
 String getName()
          Values name -- for printing purposes (E.g., Monday 7:30)
 int hashCode()
           
 int nrAssigned()
           
 int size()
           
 double toDouble()
          Dobouble representaion.
 String toString()
           
 Value[] values()
           
 
Methods inherited from class net.sf.cpsolver.ifs.model.Value
assigned, compareTo, conflicts, countAssignments, getDescription, getExtra, getId, isConsistent, lastAssignmentIteration, lastUnassignmentIteration, setExtra, setVariable, unassigned, valueEquals, variable
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiValue

public MultiValue(MultiVariable variable,
                  Value[] values)
Constructor

Parameters:
variable - multi variable
values - a value for every "normal" variable of the multi variable

MultiValue

public MultiValue(MultiVariable variable,
                  Value[] values,
                  Double doubleValue,
                  boolean correctOrder)
Constructor

Parameters:
variable - multi variable
values - a value for every "normal" variable of the multi variable
doubleValue - valute to be returned as toDouble()
correctOrder - indicates whether the givan values are in the correct order (first value of the first variable etc.)
Method Detail

values

public Value[] values()

size

public int size()

nrAssigned

public int nrAssigned()

getName

public String getName()
Description copied from class: Value
Values name -- for printing purposes (E.g., Monday 7:30)

Overrides:
getName in class Value

toString

public String toString()
Overrides:
toString in class Value

toDouble

public double toDouble()
Description copied from class: Value
Dobouble representaion. This allows us to have generic optimization criteria. The task is than to minimize total value of assigned variables of a solution.

Overrides:
toDouble in class Value

hashCode

public int hashCode()
Overrides:
hashCode in class Value

equals

public boolean equals(Object o)
Description copied from class: Value
By default, comparison is made on unique ids

Overrides:
equals in class Value

clone

public Object clone()
Overrides:
clone in class Object