|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.cpsolver.ifs.model.Value<V,T>
public class Value<V extends Variable<V,T>,T extends Value<V,T>>
Generic value.
Every value has a notion about the variable it belongs to. It has also a
unique id. By default, every Value has an integer value which is used in
general heuristics, the task is than to minimimize the total value of
assigned values in the solution.
Variable
,
Model
,
Solver
Field Summary | |
---|---|
protected double |
iValue
Integer value |
Constructor Summary | |
---|---|
Value(V variable)
Constructor |
|
Value(V variable,
double value)
Constructor |
Method Summary | |
---|---|
void |
assigned(long iteration)
Notification (called by variable) that this value is assigned |
int |
compareTo(T value)
|
Set<T> |
conflicts()
Returns a set of conflicting values with this value. |
long |
countAssignments()
Returns the number of assignments of this value to its variable. |
boolean |
equals(Object o)
By default, comparison is made on unique ids |
String |
getDescription()
Values description -- for printing purposes |
Object |
getExtra()
Extra information to which can be used by an extension (see Extension ). |
long |
getId()
Unique id |
String |
getName()
Values name -- for printing purposes (E.g., Monday 7:30) |
int |
hashCode()
|
boolean |
isConsistent(T value)
True, if the value is consistent with the given value |
long |
lastAssignmentIteration()
Returns the iteration when the value was assigned at last (-1 if never). |
long |
lastUnassignmentIteration()
Returns the iteration when the value was unassigned at last (-1 if never). |
void |
setExtra(Object object)
Extra information to which can be used by an extension (see Extension ). |
void |
setVariable(Variable variable)
Sets the variable which this value belongs to |
double |
toDouble()
Dobouble representaion. |
String |
toString()
|
void |
unassigned(long iteration)
Notification (called by variable) that this value is unassigned |
boolean |
valueEquals(T value)
Comparison of two values which is based only on the value (not appropriate variable etc.). toDouble() is compared by default. |
V |
variable()
Returns the variable which this value belongs to |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected double iValue
Constructor Detail |
---|
public Value(V variable)
variable
- variable which the value belongs topublic Value(V variable, double value)
variable
- variable which the value belongs tovalue
- integer valueMethod Detail |
---|
public V variable()
public void setVariable(Variable variable)
public void assigned(long iteration)
iteration
- current iterationpublic void unassigned(long iteration)
iteration
- current iterationpublic long lastAssignmentIteration()
public long lastUnassignmentIteration()
public long countAssignments()
public long getId()
public String getName()
public String getDescription()
public double toDouble()
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean valueEquals(T value)
public int compareTo(T value)
compareTo
in interface Comparable<T extends Value<V,T>>
public boolean equals(Object o)
equals
in class Object
public Object getExtra()
Extension
).
public void setExtra(Object object)
Extension
).
public boolean isConsistent(T value)
public Set<T> conflicts()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |