Skip to content
Snippets Groups Projects
Commit ba96749d authored by Peter Wagenhuber's avatar Peter Wagenhuber
Browse files

need another test architecture

parent b43ef99f
No related branches found
No related tags found
No related merge requests found
...@@ -180,19 +180,19 @@ public class Nloc { ...@@ -180,19 +180,19 @@ public class Nloc {
List<List<SequenceTuple>> oldsequences; List<List<SequenceTuple>> oldsequences;
do { do {
oldsequences = new ArrayList<List<SequenceTuple>>(sequences); oldsequences = new ArrayList<List<SequenceTuple>>(sequences);
System.out.println("oldseq: " + oldsequences); //System.out.println("oldseq: " + oldsequences);
System.out.println(""); //System.out.println("");
List<List<SequenceTuple>> tmpSeqs = new ArrayList<List<SequenceTuple>>(); List<List<SequenceTuple>> tmpSeqs = new ArrayList<List<SequenceTuple>>();
System.out.println("sequences before for computing: " + sequences); //System.out.println("sequences before for computing: " + sequences);
System.out.println(""); //System.out.println("");
for (List<SequenceTuple> stl: sequences) { for (List<SequenceTuple> stl: sequences) {
tmpSeqs.addAll( tmpSeqs.addAll(
this.computeSequences(stl)); this.computeSequences(stl));
} }
sequences = tmpSeqs; sequences = tmpSeqs;
System.out.println("sequences after for computing: " + sequences); //System.out.println("sequences after for computing: " + sequences);
System.out.println(""); //System.out.println("");
System.out.println(""); //System.out.println("");
} while (sequences.size() != oldsequences.size()); } while (sequences.size() != oldsequences.size());
} catch (Exception e) { } catch (Exception e) {
System.out.println( e.getMessage()); System.out.println( e.getMessage());
...@@ -276,7 +276,7 @@ public class Nloc { ...@@ -276,7 +276,7 @@ public class Nloc {
this.moveDroplets(); this.moveDroplets();
} catch (CoalescedDropletException e) { } catch (CoalescedDropletException e) {
works = false; works = false;
System.out.println(e.getDroplet()); System.out.println("Coalesce! Droplet: " + e.getDroplet().getName() + " Position: " + e.getDroplet().getPosition().getChannel().getName());
break; break;
} }
} }
...@@ -519,8 +519,8 @@ public class Nloc { ...@@ -519,8 +519,8 @@ public class Nloc {
//possibleSequences.add(seqTupList); //possibleSequences.add(seqTupList);
if (dropletPath.contains(currentBifurcation) && prio > 0 && if (dropletPath.contains(currentBifurcation) && prio > 0 &&
!(currentBifurcation instanceof Pump)) { !(currentBifurcation instanceof Pump)) {
System.out.println("we need header for: " + currentSeqTup.getDroplet() + " " + currentSeqTup.getDroplet().getName()); //System.out.println("we need header for: " + currentSeqTup.getDroplet() + " " + currentSeqTup.getDroplet().getName());
System.out.println("At: " + currentBifurcation.getName()); //System.out.println("At: " + currentBifurcation.getName());
// we need header droplet // we need header droplet
// cirst check all possible paths of header droplets // cirst check all possible paths of header droplets
......
...@@ -62,26 +62,32 @@ public class TestNloc { ...@@ -62,26 +62,32 @@ public class TestNloc {
//printPaths(allPaths); //printPaths(allPaths);
//TODO: this //TODO: this
String[] mtv = {"h0", "m2", "m3"}; //String[] mtv = {"h3", "m1", "m3", "m0", "m5"};
try { //try {
List<List<SequenceTuple>> stll = nl.getPossibleSequences(mtv); // List<List<SequenceTuple>> stll = nl.getPossibleSequences(mtv);
printSequences(stll); // printSequences(stll);
} catch (NoSuchModuleException e) { //} catch (NoSuchModuleException e) {
System.out.println(e.getMessage()); // System.out.println(e.getMessage());
}
//int count = 0;
//for (List<Channel> path: allPaths) {
// String[] modulesToVisit = extractModuleStringArrayFromPath(path);
// System.out.println("Modules to visit: ");
// for (String str: modulesToVisit) {
// System.out.print(str + " " );
// }
// System.out.println("Pathnum: " + count++);
// Pump p = nl.getShortestSequence(modulesToVisit);
// printPumpcontents(p);
//} //}
int count = 0;
for (List<Channel> path: allPaths) {
String[] modulesToVisit = extractModuleStringArrayFromPath(path);
System.out.println("Modules to visit: ");
for (String str: modulesToVisit) {
System.out.print(str + " " );
}
System.out.println("Pathnum: " + count++);
try {
List<List<SequenceTuple>> stll = nl.getPossibleSequences(modulesToVisit);
printSequences(stll);
} catch (Exception e) {
e.printStackTrace();
}
//Pump p = nl.getShortestSequence(modulesToVisit);
//printPumpcontents(p);
}
//Droplet pld = new Droplet(DropletType.PAYLOAD,"p"); //Droplet pld = new Droplet(DropletType.PAYLOAD,"p");
//Droplet hdr = new Droplet(DropletType.HEADER,"h"); //Droplet hdr = new Droplet(DropletType.HEADER,"h");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment