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

added function to initialize the bifurcation table with all bifurcs on desired path

parent 23b098f7
No related branches found
No related tags found
No related merge requests found
package nloc;
public class BFTableEntry {
private int minTimediff, maxTimediff;
private int noOfDroplets;
private int bfPathPriority;
private int bfMinSteps;
public BFTableEntry(int bfPathPriority, int bfMinSteps) {
this.minTimediff = Nloc.MIN_TIMEDIFF;
this.maxTimediff = Nloc.MIN_TIMEDIFF + 2;
this.noOfDroplets = 1;
this.bfMinSteps = bfMinSteps;
this.bfPathPriority = bfPathPriority;
}
public int getMinTimediff() {
return minTimediff;
}
public int getMaxTimediff() {
return maxTimediff;
}
public int getNoOfDroplets() {
return noOfDroplets;
}
public int getBfPathPriority() {
return bfPathPriority;
}
public int getBfMinSteps() {
return bfMinSteps;
}
public void setMinTimediff(int minTimediff) {
this.minTimediff = minTimediff;
}
public void setMaxTimediff(int maxTimediff) {
this.maxTimediff = maxTimediff;
}
public void setNoOfDroplets(int noOfDroplets) {
this.noOfDroplets = noOfDroplets;
}
public void setBfPathPriority(int bfPathPriority) {
this.bfPathPriority = bfPathPriority;
}
public void setBfMinSteps(int bfMinSteps) {
this.bfMinSteps = bfMinSteps;
}
}
......@@ -114,6 +114,10 @@ public class Channel extends NlocEntity implements Comparable<Channel> {
return parents;
}
public boolean isBifurcation() {
return (!(this instanceof Pump) && children.size() > 1);
}
public int compareTo(Channel other) {
if (this.getPSteps() < other.getPSteps()) {
return -1;
......
......@@ -67,6 +67,23 @@ public class Nloc {
}
}
public List<BFTableEntry> initializeBifTable(List<Channel> desiredPath) {
List<BFTableEntry> bftable = new ArrayList<BFTableEntry>();
ListIterator<Channel> iter = path.listIterator();
while(iter.hasNext()) {
Channel current = iter.next();
if (current.isBifurcation()) {
Channel following = iter.next();
int prio = current.getChildrenList().indexOf(following) + 1;
int bfMinSteps = current.getChildrenList().get(0).getHSteps();
bftable.add(new BFTableEntry(prio, bfMinSteps));
iter.previous();
}
}
return bftable;
}
//public Pump generateDropletSequence(List<String> modules)
// throws NlocStructureException {
......
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