Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
droplet-sequence-generator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
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
pedatestcontrib
droplet-sequence-generator
Commits
ba96749d
Commit
ba96749d
authored
7 years ago
by
Peter Wagenhuber
Browse files
Options
Downloads
Patches
Plain Diff
need another test architecture
parent
b43ef99f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Nloc.java
+10
-10
10 additions, 10 deletions
src/Nloc.java
src/TestNloc.java
+25
-19
25 additions, 19 deletions
src/TestNloc.java
with
35 additions
and
29 deletions
src/Nloc.java
+
10
−
10
View file @
ba96749d
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/TestNloc.java
+
25
−
19
View file @
ba96749d
...
@@ -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");
...
...
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