Implements single instances of weights. More...
Public Member Functions | |
| int | compareTo (SingletonWeightComparable< T > w) |
| Method to be able to compare the current weight to another based on the ordering defined on 'T'. | |
| Public Member Functions inherited from umontreal.ssj.latnetbuilder.weights.SingletonWeight< T > | |
| T | getIndex () |
| Returns the current 'index'. | |
| void | setIndex (T ind) |
| Sets the index of the weight to 'ind'. | |
| double | getWeight () |
| Returns the current value of the weight. | |
| void | setWeight (double w) |
| Sets the value of the weight to 'w'. | |
Package Functions | |
| SingletonWeightComparable (T ind, double w) | |
| Constructs a single comparable weight with given 'index' and 'weight'. | |
| Package Functions inherited from umontreal.ssj.latnetbuilder.weights.SingletonWeight< T > | |
| SingletonWeight (T ind, double w) | |
| Constructs a weight with given 'index' and 'weight'. | |
Implements single instances of weights.
The template parameter 'T' indicates the data type of the associated index, for instance, 'Integer' for the order of an OrderDependentWeight. In contrast to its superclass SingletonWeight, weights from this class can be compared via an ordering defined on 'T'.
| <T> | indicates the data type of the index of the weight (e.g. Integer,...). This data type needs to be comparable. |
Definition at line 16 of file SingletonWeightComparable.java.
|
package |
Constructs a single comparable weight with given 'index' and 'weight'.
| ind | the desired index. |
| w | the desired value for the weight. |
Definition at line 25 of file SingletonWeightComparable.java.
| int umontreal.ssj.latnetbuilder.weights.SingletonWeightComparable< T extends Comparable< T > >.compareTo | ( | SingletonWeightComparable< T > | w | ) |
Method to be able to compare the current weight to another based on the ordering defined on 'T'.
This enables sorting the weights by their index.
Definition at line 33 of file SingletonWeightComparable.java.