Commit 48e585b1 authored by Peter Wagenhuber's avatar Peter Wagenhuber
Browse files

teste die only default header droplets heuristik

parent f79c1e4f
......@@ -124,6 +124,10 @@ public class Nloc {
s1.add(hstup);
}
}
if (oldSeqTupListLen < s1.size()) {
s1.clear();
suitableHeaderFound = false;
}
}
} else {
// no header needed just ascend to next bifurcation
......
......@@ -16,25 +16,25 @@ public class TestNloc {
List<List<Channel>> allPaths = nl.getAllPaths();
String[] mtv = { "h0", "d0", "m2", "m3"};
//String[] mtv = { "h0", "d0", "m2", "m3"};
try {
List<Channel> ptt = nl.getDesiredPath(nl.getModulesByName(Arrays.asList(mtv)),allPaths);
System.out.println("only defaults: " + nl.pathOnlyContainsDefaults(ptt));
} catch (Exception e) {
System.out.println(e.getMessage());
}
//try {
// List<Channel> ptt = nl.getDesiredPath(nl.getModulesByName(Arrays.asList(mtv)),allPaths);
// System.out.println("only defaults: " + nl.pathOnlyContainsDefaults(ptt));
//} catch (Exception e) {
// System.out.println(e.getMessage());
//}
Droplet hdr1 = new Droplet(DropletType.HEADER,"h1");
Droplet hdr2 = new Droplet(DropletType.HEADER,"h2");
//Droplet hdr1 = new Droplet(DropletType.HEADER,"h1");
//Droplet hdr2 = new Droplet(DropletType.HEADER,"h2");
SequenceTuple st1 = new SequenceTuple(hdr1,allPaths.get(0),4,3);
SequenceTuple st2 = new SequenceTuple(hdr2,allPaths.get(0),4,3);
List<SequenceTuple> stl = new ArrayList<SequenceTuple>();
stl.add(st1);
//SequenceTuple st1 = new SequenceTuple(hdr1,allPaths.get(0),4,3);
//SequenceTuple st2 = new SequenceTuple(hdr2,allPaths.get(0),4,3);
//List<SequenceTuple> stl = new ArrayList<SequenceTuple>();
//stl.add(st1);
System.out.println("SequenceTuple conflicting: " + SequenceTuple.conflictingOffsets(st2,stl));
//int count = 0;
//System.out.println("SequenceTuple conflicting: " + SequenceTuple.conflictingOffsets(st2,stl));
int count = 0;
////
////String[] mtv = { m2 d1 m4 h2 m1 d5}; // S3 problem
////String[] mtv = { "f2", "m3", "h0", "m5"}; //old S2 problem
......@@ -50,29 +50,30 @@ public class TestNloc {
////printDropletSequence(drlist);
////printPumpcontents(p);
//for (List<Channel> path: allPaths) {
// String[] modulesToVisit = extractModuleStringArrayFromPath(path);
// System.out.println("Pathnum: " + count++);
// System.out.println("Modules to visit: ");
// for (String str: modulesToVisit) {
// System.out.print(str + " " );
// }
// System.out.println("");
// try {
// List<List<SequenceTuple>> stll = nl.getPossibleSequencesExhaustive(modulesToVisit);
// //printSequences(stll);
// } catch (Exception e) {
// e.printStackTrace();
// }
// List<Droplet> drlist = nl.getShortestSequenceExhaustive(modulesToVisit);
// printDropletSequence(drlist);
//}
for (List<Channel> path: allPaths) {
String[] modulesToVisit = extractModuleStringArrayFromPath(path);
System.out.println("Pathnum: " + count++);
System.out.println("Modules to visit: ");
for (String str: modulesToVisit) {
System.out.print(str + " " );
}
System.out.println("");
//try {
// List<List<SequenceTuple>> stll = nl.getPossibleSequencesExhaustive(modulesToVisit);
// //printSequences(stll);
//} catch (Exception e) {
// e.printStackTrace();
//}
//List<Droplet> drlist = nl.getShortestSequenceExhaustive(modulesToVisit);
List<Droplet> drlist = nl.getShortestSequenceOnlyDefaultPathHeader(modulesToVisit);
printDropletSequence(drlist);
}
}
public static void printDropletSequence(List<Droplet> drList) {
if (drList.isEmpty()) {
if (drList == null || drList.isEmpty()) {
System.out.println("No Sequence Found");
} else {
for (Droplet dr: drList) {
......
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