Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
droplet-sequence-generator
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Peter Wagenhuber
droplet-sequence-generator
Commits
df007cc5
Commit
df007cc5
authored
8 years ago
by
Peter Wagenhuber
Browse files
Options
Downloads
Patches
Plain Diff
grad auf halbem weg zur generiertung der moeglichen sequenzen an einer bifurcation
parent
ba9424c2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/Droplet.java
+9
-1
9 additions, 1 deletion
src/Droplet.java
src/Nloc.java
+54
-26
54 additions, 26 deletions
src/Nloc.java
src/SequenceTuple.java
+2
-2
2 additions, 2 deletions
src/SequenceTuple.java
with
65 additions
and
29 deletions
src/Droplet.java
+
9
−
1
View file @
df007cc5
...
@@ -15,6 +15,12 @@ public class Droplet {
...
@@ -15,6 +15,12 @@ public class Droplet {
this
.
position
.
getChannel
().
addDroplet
(
this
);
this
.
position
.
getChannel
().
addDroplet
(
this
);
}
}
public
Droplet
(
DropletType
type
)
{
this
.
position
=
null
;
this
.
type
=
type
;
this
.
pumpOutlet
=
null
;
}
public
void
move
()
{
public
void
move
()
{
position
.
increment
(
this
);
position
.
increment
(
this
);
}
}
...
@@ -101,7 +107,9 @@ public class Droplet {
...
@@ -101,7 +107,9 @@ public class Droplet {
}
}
public
void
setPosition
(
Position
position
)
{
public
void
setPosition
(
Position
position
)
{
this
.
position
.
getChannel
().
removeDroplet
(
this
);
if
(
position
!=
null
)
{
this
.
position
.
getChannel
().
removeDroplet
(
this
);
}
this
.
position
=
position
;
this
.
position
=
position
;
this
.
position
.
getChannel
().
addDroplet
(
this
);
this
.
position
.
getChannel
().
addDroplet
(
this
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/Nloc.java
+
54
−
26
View file @
df007cc5
...
@@ -67,23 +67,16 @@ public class Nloc {
...
@@ -67,23 +67,16 @@ public class Nloc {
}
}
}
}
public
List
<
BFTableEntry
>
initializeBifTable
(
List
<
Channel
>
desiredPath
)
{
public
List
<
Channel
>
getBifurcationList
(
List
<
Channel
>
desiredPath
)
{
List
<
BFTableEntry
>
bftable
=
new
ArrayList
<
BFTableEntry
>();
List
<
Channel
>
bfList
=
new
ArrayList
<
Channel
>();
ListIterator
<
Channel
>
iter
=
desiredPath
.
listIterator
();
for
(
Channel
ch:
desiredPath
)
{
if
(
ch
.
isBifurcation
)
{
while
(
iter
.
hasNext
())
{
bfList
.
add
(
ch
);
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
bf
table
;
return
bf
List
;
}
}
//public Pump generateDropletSequence(List<String> modules)
//public Pump generateDropletSequence(List<String> modules)
...
@@ -95,8 +88,8 @@ public class Nloc {
...
@@ -95,8 +88,8 @@ public class Nloc {
// List<List<Channel>> pathlist = this.getAllPaths();
// List<List<Channel>> pathlist = this.getAllPaths();
// List<Channel> desiredPath = getDesiredPath(modPath, pathlist);
// List<Channel> desiredPath = getDesiredPath(modPath, pathlist);
// List<
BFTableEntry
> bftable = calcBFTable(desiredPath);
// List<
SequenceTuple
> bftable = calcBFTable(desiredPath);
//
BFTableEntry
startConfiguration = bftable.get(0);
//
SequenceTuple
startConfiguration = bftable.get(0);
// pump = createDropletsequenceInPump(pump, startConfiguration);
// pump = createDropletsequenceInPump(pump, startConfiguration);
...
@@ -104,7 +97,7 @@ public class Nloc {
...
@@ -104,7 +97,7 @@ public class Nloc {
//}
//}
//private Pump createDropletsequenceInPump(Pump pump,
//private Pump createDropletsequenceInPump(Pump pump,
//
BFTableEntry
startConfiguration) {
//
SequenceTuple
startConfiguration) {
// int noOfDroplets = startConfiguration.getNoOfDroplets();
// int noOfDroplets = startConfiguration.getNoOfDroplets();
// int minTimediff = startConfiguration.getMinTimediff();
// int minTimediff = startConfiguration.getMinTimediff();
...
@@ -220,20 +213,55 @@ public class Nloc {
...
@@ -220,20 +213,55 @@ public class Nloc {
}
}
}
}
public
List
<
List
<
Channel
>>
getSequencesAtBifurcation
(
public
List
<
List
<
SequenceTuple
>>
getSequencesAtBifurcation
(
List
<
Channel
>
path
,
Channel
currentChan
)
{
List
<
SequenceTuple
>
seqTup
,
SequenceTuple
currentSeqTup
,
Channel
currentBifurcation
)
{
List
<
List
<
SequenceTuple
>>
seqTupList
=
new
ArrayList
<
List
<
SequenceTuple
>>();
List
<
List
<
Channel
>>
chanList
=
new
ArrayList
<
List
<
Channel
>>();
getSequencesAtBifurcationRecursive
(
seqTup
,
currentSeqTup
,
seqTupList
,
getSequencesAtBifurcationRecursive
(
path
,
currentChan
,
chanList
);
currentBifurcation
);
return
chanList
;
return
seqTupList
;
}
}
private
void
getSequencesAtBifurcationRecursive
(
private
void
getSequencesAtBifurcationRecursive
(
List
<
Channel
>
path
,
Channel
currentChan
,
List
<
SequenceTuple
>
seqTupList
,
SequenceTuple
currentSeqTup
,
List
<
List
<
Channel
>>
possibleSequences
)
{
List
<
List
<
SequenceTuple
>>
possibleSequences
,
Channel
currentBifurcation
)
{
if
(
currentSeqTup
.
equals
(
seqTupList
.
get
(
seqTupList
.
size
()
-
1
)))
{
// if at last sequence tuple add another header droplet tuple if needed
// and add the list of sequence tuples to the possible sequences list
// check if header droplet is needed
List
<
Channel
>
dropletPath
=
currentSeqTup
.
getPath
();
Channel
bifurcSuccessor
=
dropletPath
.
get
(
dropletPath
.
indexOf
(
currentBifurcation
)
+
1
);
// bifurcation priority: prio = 0 if default channel; prio >= 1 if not
// default and threrfore header droplet needed
int
prio
=
currentBifurcation
.
getChildrenList
().
indexOf
(
bifurcSuccessor
);
if
(
dropletPath
.
contains
(
currentBifurcation
)
&&
prio
>
0
)
{
// we need header droplet
// cirst check all possible paths of heder droplets
List
<
List
<
Channel
>>
pathList
=
this
.
getAllPathsFromTo
(
dropletPath
.
get
(
0
),
currentBifurcation
.
getChildrenList
().
get
(
0
));
for
(
List
<
Channel
>
path:
pathList
)
{
List
<
SequenceTuple
>
tmp
=
new
ArrayList
<
SequenceTuple
>(
seqTupList
);
tmp
.
add
(
new
SequenceTuple
(
new
Droplet
(
DropletType
.
HEADER
),
path
));
// TODO: berechnen und setzen von den pump offsets
possibleSequences
.
add
(
tmp
);
}
}
if
(
currentChan
.
equals
(
path
.
get
(
path
.
size
()
-
1
)))
{
}
else
{
}
else
{
...
...
This diff is collapsed.
Click to expand it.
src/
BFTableEntry
.java
→
src/
SequenceTuple
.java
+
2
−
2
View file @
df007cc5
package
nloc
;
package
nloc
;
public
class
BFTableEntry
{
public
class
SequenceTuple
{
private
Droplet
droplet
;
private
Droplet
droplet
;
private
int
minPos
,
maxPos
;
private
int
minPos
,
maxPos
;
private
List
<
Channel
>
path
;
private
List
<
Channel
>
path
;
public
BFTableEntry
(
Droplet
droplet
,
List
<
Channel
>
path
)
{
public
SequenceTuple
(
Droplet
droplet
,
List
<
Channel
>
path
)
{
this
.
minPos
=
0
;
this
.
minPos
=
0
;
this
.
maxPos
=
0
;
this
.
maxPos
=
0
;
this
.
droplet
=
droplet
;
this
.
droplet
=
droplet
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment