I have 4 parts, every part 10000 times, which should fit into case, and the dimensions of the parts are given by uniform, normal and triangular distribution by randomly generating numbers in added dimensions of each distribution.
For each 4 parts there is decision if they fit or not. But that shouldn't be a problem.
I've managed somehow to do uniform and normal distribution:
public double uniformDistrubution(double min, double max) {
Random rand = new Random();
return Math.random() * max + min;
}
public double normalDistrubution(double mean, double std) {
Random rng = new Random();
return mean + std * rng.nextGaussian();
}
But I cannot figure out the triangular one. I've the dimensions for it:
a = 7:6, b = 8:0, c = 8:4