1package umontreal.ssj.latnetbuilder.weights;
3import java.io.FileWriter;
4import java.io.IOException;
5import java.util.ArrayList;
8import umontreal.ssj.mcqmctools.anova.CoordinateSet;
9import umontreal.ssj.mcqmctools.anova.CoordinateSetLong;
25 protected String fileDir =
"";
26 protected String fileName =
"";
78 orderDependentWeights.add(weight);
89 orderDependentWeights.add(order, weight);
110 public void write() throws IOException {
111 FileWriter file =
new FileWriter(fileDir + fileName);
112 StringBuffer sb =
new StringBuffer(
"");
115 sb.append(w.getIndex().toStringNoBraces() +
":\t" + w.getWeight() +
"\n");
118 sb.append(
"order " + w.getIndex() +
":\t" + w.getWeight() +
"\n");
120 file.write(sb.toString());
131 StringBuffer sb =
new StringBuffer(
"");
132 sb.append(
"Order dependent weights [default = " +
getDefaultWeight() +
"]\n");
135 sb.append(String.format(
"%20s: %1.8g%n", w.getIndex().toString(), w.getWeight()));
138 sb.append(String.format(
"%20s: %1.8g%n",
"order " + w.getIndex(), w.getWeight()));
140 return sb.toString();
144 String str =
"file:" + fileDir + fileName;
Class implementing order dependent weights.
Class implementing projection dependent weights.
String getFileDir()
Returns the directory to which an output-file can be generated.
void setFileDir(String dir)
Sets the directory to which an output-file can be generated.
void setOrderDependentWeights(ArrayList< SingletonWeightComparable< Integer > > ordWeights)
Assigns an entire list of comparable 'SingleTonWeights' as order dependent weights to orderDependentW...
void addOrderDependentWeight(int order, double weight)
Adds an order dependent weight to orderDependentWeights.
String toString()
Creates a formatted output of the projection dependent weights.
String getFileName()
Returns the name of the file to which an output can be generated.
void addOrderDependentWeight(SingletonWeightComparable< Integer > weight)
Adds an order dependent weight to orderDependentWeights.
void addOrderDependentWeight()
Instantiates the parameter orderDependentWeights.
void setFileName(String name)
Sets the name of the file to which an output can be generated.
void write()
Writes a file with name fileName to the directory fileDir containing information on the weights.
Implements single instances of weights.
Implements a single instance of a weight for search-algorithms for quasi-Monte Carlo point sets as,...
abstract String toLatNetBuilder()
double getDefaultWeight()
Weights(List< SingletonWeight< T > > w)