All working, able to be built to .jar
This commit is contained in:
@@ -8,14 +8,23 @@ public class Plate {
|
||||
private Random rand = new Random();
|
||||
private int size;
|
||||
private double error;
|
||||
private Integer[] concentrations;
|
||||
private double stdDev;
|
||||
|
||||
public Plate (int size, double error) {
|
||||
public Plate (int size, double error, Integer[] concentrations, double stdDev) {
|
||||
this.size = size;
|
||||
this.error = error;
|
||||
this.concentrations = concentrations;
|
||||
this.stdDev = stdDev;
|
||||
wells = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void fillWells(List<Integer[]> cells, int[] concentrations, double stdDev) {
|
||||
public Plate(List<List<Integer[]>> wells){
|
||||
this.wells = wells;
|
||||
this.size = wells.size();
|
||||
}
|
||||
|
||||
public void fillWells(List<Integer[]> cells) {
|
||||
int numSections = concentrations.length;
|
||||
int section = 0;
|
||||
double m;
|
||||
@@ -26,8 +35,8 @@ public class Plate {
|
||||
List<Integer[]> well = new ArrayList<>();
|
||||
for (int j = 0; j < concentrations[section]; j++) {
|
||||
do {
|
||||
m = Math.abs(rand.nextGaussian()) * stdDev;
|
||||
} while (m >= cells.size());
|
||||
m = (rand.nextGaussian() * stdDev) + (cells.size() / 2);
|
||||
} while (m >= cells.size() || m < 0);
|
||||
n = (int) Math.floor(m);
|
||||
Integer[] cellToAdd = cells.get(n).clone();
|
||||
drop = Math.abs(rand.nextDouble()) < error;
|
||||
@@ -46,6 +55,31 @@ public class Plate {
|
||||
}
|
||||
}
|
||||
|
||||
public void writePlateToFile(String filename) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
public Integer[] getConcentrations(){
|
||||
return concentrations;
|
||||
}
|
||||
|
||||
public int getSize(){
|
||||
return size;
|
||||
}
|
||||
|
||||
public double getStdDev() {
|
||||
return stdDev;
|
||||
}
|
||||
|
||||
public double getError() {
|
||||
return error;
|
||||
}
|
||||
|
||||
public List<List<Integer[]>> getWells() {
|
||||
return wells;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> assayWellsAlpha() {
|
||||
return this.assayWellsAlpha(0, size);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user