Commit bb5b389b authored by Peter Wagenhuber's avatar Peter Wagenhuber
Browse files

berechnung der position sollte jetzt stimmen. fixes #5

parent 18c0e534
......@@ -29,6 +29,16 @@ public class Nloc {
possibleSequences.sort((a,b) -> a.size() - b.size());
List<SequenceTuple> currentSeq = possibleSequences.get(0);
//for (SequenceTuple seqTup: currentSeq) {
// System.out.println("Droplet: " + seqTup.getDroplet().getName() + " Minpos: " + seqTup.getMinPos() + " Maxpos: " + seqTup.getMaxPos());
// System.out.print("Path: ");
// List<Channel> dropletpath = seqTup.getPath();
// for (Channel ch: dropletpath) {
// System.out.print(" ch: " + ch.getName() + " len: " + ch.getHSteps());
// }
// System.out.println("");
//}
//System.out.println("");
int min = 0, max = 0;
for (SequenceTuple stl: currentSeq) {
......@@ -39,9 +49,7 @@ public class Nloc {
int span = max - min;
pump.setSteps(span);
possibleSequences = setTuplePumpoffsetToPumpPosition(possibleSequences,
min);
currentSeq = possibleSequences.get(0);
currentSeq = setTuplePumpoffsetToPumpPosition(currentSeq, min);
List<Droplet> dropletSequence = generateDropletListRecursive(new ArrayList<Droplet>(), currentSeq, currentSeq.get(0).getMinPos());
......@@ -53,19 +61,23 @@ public class Nloc {
return pump;
}
public List<List<SequenceTuple>> setTuplePumpoffsetToPumpPosition(
List<List<SequenceTuple>> possibleSequences, int minOffset) {
/*
* TODO: comment on the parameters of the function
*
*/
public List<SequenceTuple> setTuplePumpoffsetToPumpPosition(
List<SequenceTuple> currentSequence, int minOffset) {
for (List<SequenceTuple> stl: possibleSequences) {
for (SequenceTuple stup: stl) {
//for (List<SequenceTuple> stl: currentSequence) {
for (SequenceTuple stup: currentSequence) {
int pumpOffsetMin = stup.getMinPos();
stup.setMinPos(pumpOffsetMin + Math.abs(minOffset));
int pumpOffsetMax = stup.getMaxPos();
stup.setMaxPos(pumpOffsetMax + Math.abs(minOffset));
}
}
return possibleSequences;
//}
return currentSequence;
}
public List<Droplet> generateDropletListRecursive(
......
......@@ -39,8 +39,8 @@ public class TestNloc {
} else {
System.out.print(" | ");
}
System.out.println("");
}
System.out.println("");
}
public static String[] extractModuleStringArrayFromPath(List<Channel> path) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment