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
a8422a02
Commit
a8422a02
authored
7 years ago
by
Peter Wagenhuber
Browse files
Options
Downloads
Patches
Plain Diff
just to push to server
parent
eba56a3e
No related branches found
Branches containing commit
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
+6
-0
6 additions, 0 deletions
src/Nloc.java
src/SequenceTuple.java
+0
-39
0 additions, 39 deletions
src/SequenceTuple.java
with
6 additions
and
39 deletions
src/Nloc.java
+
6
−
0
View file @
a8422a02
...
...
@@ -94,6 +94,12 @@ public class Nloc {
// return tmpSeqs;
// }
public
Pump
getShortestSequence
(
String
[]
modulesToVisit
)
{
List
<
List
<
SequenceTuple
>>
possibleSequences
=
getPossibleSequences
(
modulesToVisit
);
}
public
List
<
List
<
SequenceTuple
>>
getPossibleSequences
(
String
[]
modulesToVisit
)
throws
NoSuchModuleException
{
...
...
This diff is collapsed.
Click to expand it.
src/SequenceTuple.java
+
0
−
39
View file @
a8422a02
...
...
@@ -22,22 +22,6 @@ public class SequenceTuple {
this
.
path
=
path
;
}
public
static
SequenceTuple
merge
(
SequenceTuple
first
,
SequenceTuple
second
)
{
int
min
,
max
;
if
(
first
.
getMinPos
()
<
second
.
getMinPos
())
{
min
=
second
.
getMinPos
();
}
else
{
min
=
first
.
getMinPos
();
}
if
(
first
.
getMaxPos
()
>
second
.
getMaxPos
())
{
max
=
second
.
getMaxPos
();
}
else
{
max
=
first
.
getMaxPos
();
}
return
new
SequenceTuple
(
new
Droplet
(
DropletType
.
HEADER
),
first
.
getPath
(),
min
,
max
);
}
public
int
getMinPos
()
{
return
minPos
;
}
...
...
@@ -69,27 +53,4 @@ public class SequenceTuple {
public
void
setPath
(
List
<
Channel
>
path
)
{
this
.
path
=
path
;
}
public
boolean
overlaps
(
SequenceTuple
other
)
{
int
max
,
min
;
int
otherMin
=
other
.
getMinPos
();
int
otherMax
=
other
.
getMaxPos
();
if
(
maxPos
>
otherMax
)
{
max
=
maxPos
;
}
else
{
max
=
otherMax
;
}
if
(
minPos
<
otherMin
)
{
min
=
minPos
;
}
else
{
min
=
otherMin
;
}
int
thisIntervalLen
=
maxPos
-
minPos
;
int
otherIntervalLen
=
otherMax
-
otherMin
;
int
overallIntervalLen
=
max
-
min
;
return
(
thisIntervalLen
+
otherIntervalLen
)
<=
overallIntervalLen
;
}
}
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