SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
PODWeights.java
1package umontreal.ssj.latnetbuilder.weights;
2
3import java.io.IOException;
4import java.util.List;
5
6import umontreal.ssj.mcqmctools.anova.CoordinateSet;
7import umontreal.ssj.mcqmctools.anova.CoordinateSetLong;
8
18
19public class PODWeights extends Weights {
20
29
36 public PODWeights(ProductWeights pWeights, OrderDependentWeights odWeights) {
37 this.productWeights = pWeights;
38 this.orderDependentWeights = odWeights;
39 }
40
47 public PODWeights(ProductWeights pWeights) {
48 this.productWeights = pWeights;
49 this.orderDependentWeights = new OrderDependentWeights();
50 }
51
59 this.productWeights = new ProductWeights();
60 this.orderDependentWeights = odWeights;
61 }
62
66 public PODWeights() {
67 this.productWeights = new ProductWeights();
68 this.orderDependentWeights = new OrderDependentWeights();
69 }
70
79
84 this.productWeights = productWeights;
85 }
86
95
100 this.orderDependentWeights = orderDependentWeights;
101 }
102
111
119 public void addOrderDependentWeight(int ord, double weight) {
120 orderDependentWeights.add(ord, weight);
121 }
122
129 productWeights.add(weight);
130 }
131
139 public void addProductWeight(int index, double weight) {
140 productWeights.add(index, weight);
141 }
142
143 @Override
144 public String toString() {
145 StringBuffer sb = new StringBuffer("");
146 sb.append("POD weights:\n");
147 sb.append(productWeights.toString() + "\n");
148 sb.append(orderDependentWeights.toString());
149 return sb.toString();
150 }
151
152 @Override
153 public String toLatNetBuilder() {
154 StringBuffer sb = new StringBuffer("");
155 sb.append("POD:" + orderDependentWeights.getDefaultWeight());
156 if (orderDependentWeights.weights.size() > 0) {
157 sb.append(":");
158 sb.append(orderDependentWeights.printBody());
159 }
160 sb.append(":" + productWeights.getDefaultWeight());
161 if (productWeights.weights.size() > 0) {
162 sb.append(":");
163 sb.append(productWeights.printBody());
164 }
165 return sb.toString();
166 }
167
168}
void setProductWeights(ProductWeights productWeights)
Setter for the product weight-component.
PODWeights(OrderDependentWeights odWeights)
Constructor for given orderDependentWeights and productWeights is constructed by the default construc...
void setOrderDependentWeights(OrderDependentWeights orderDependentWeights)
Setter for the order dependent weight-component.
OrderDependentWeights getOrderDependentWeights()
Getter for the order dependent weight-component.
void addProductWeight(int index, double weight)
Adds a product weight by passing the coordinate index and the value of the weight.
String toString()
Basic formatted string-output.
String toLatNetBuilder()
Provides a String that can be interpreted by the command line interface of LatNetBuilder.
void addOrderDependentWeight(SingletonWeightComparable< Integer > weight)
Adds the order dependent weight 'weight'.
PODWeights(ProductWeights pWeights)
Constructor for given productWeights and orderDependentWeights is constructed by the default construc...
ProductWeights productWeights
The product weight-component.
void addOrderDependentWeight(int ord, double weight)
Adds an order dependent weight by passing the order and the value of the weight.
OrderDependentWeights orderDependentWeights
The order dependent weight-component.
void addProductWeight(SingletonWeightComparable< Integer > weight)
Adds the product weight 'weight'.
PODWeights(ProductWeights pWeights, OrderDependentWeights odWeights)
Constructs an instance of POD weights.
ProductWeights getProductWeights()
Getter for the product weight-component.
Weights(List< SingletonWeight< T > > w)
Constructs weights from a list of SingletonWeights.
Definition Weights.java:33