1package umontreal.ssj.latnetbuilder.weights;
3import java.util.ArrayList;
26 protected ArrayList<SingletonWeight<T>> weights;
34 weights =
new ArrayList<SingletonWeight<T>>(w);
41 weights =
new ArrayList<SingletonWeight<T>>();
78 boolean added =
false;
80 if (w.getIndex() == singletonWeight.
getIndex() && (!added)) {
81 weights.set(weights.indexOf(w), singletonWeight);
86 weights.add(singletonWeight);
96 public void add(T index,
double weight) {
104 StringBuffer sb =
new StringBuffer(
"");
109 sb.append(w.getWeight() +
",");
110 sb.deleteCharAt(sb.length() - 1);
112 return sb.toString();
Implements a single instance of a weight for search-algorithms for quasi-Monte Carlo point sets as,...
T getIndex()
Returns the current 'index'.
ArrayList< SingletonWeight< T > > getWeights()
Returns the current weights as a list.
void add(SingletonWeight< T > singletonWeight)
Adds a new weight.
Weights()
Initializes an empty list of weights.
double defaultWeight
Weight to be used for indices that were not explicitly set.
String toString()
Basic formatted string-output.
abstract String toLatNetBuilder()
Provides a String that can be interpreted by the command line interface of LatNetBuilder.
double getDefaultWeight()
Returns the current 'defaultWeight'.
Weights(List< SingletonWeight< T > > w)
Constructs weights from a list of SingletonWeights.
void setDefaultWeight(double dWeight)
Sets 'dWeight' as the current 'defaultWeight'.
void add(T index, double weight)
Adds a new weight with index 'index' and weight 'weight' or overwrites it, if the index already exist...