Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Thomas Vachuska
2014-10-27 15:18:10 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4353a5a390f457a14e87afff702409c82af12bf9
4353a5a3
1 parent
59f9b885
Fixed graph relaxEdge to properly deal with Double.MIN_VALUE.
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
core/net/src/main/java/org/onlab/onos/net/intent/impl/PointToPointIntentCompiler.java
utils/misc/src/main/java/org/onlab/graph/AbstractGraphPathSearch.java
core/net/src/main/java/org/onlab/onos/net/intent/impl/PointToPointIntentCompiler.java
View file @
4353a5a
...
...
@@ -108,7 +108,7 @@ public class PointToPointIntentCompiler
if
(
lt
==
Link
.
Type
.
OPTICAL
)
{
return
1000.0
;
}
else
{
return
1.0
;
return
Double
.
MIN_VALUE
;
}
}
};
...
...
utils/misc/src/main/java/org/onlab/graph/AbstractGraphPathSearch.java
View file @
4353a5a
...
...
@@ -36,7 +36,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
public
abstract
class
AbstractGraphPathSearch
<
V
extends
Vertex
,
E
extends
Edge
<
V
>>
implements
GraphPathSearch
<
V
,
E
>
{
private
double
samenessThreshold
=
0.000000001
;
private
double
samenessThreshold
=
Double
.
MIN_VALUE
;
/**
* Sets a new sameness threshold for comparing cost values; default is
...
...
@@ -183,7 +183,7 @@ public abstract class AbstractGraphPathSearch<V extends Vertex, E extends Edge<V
double
newCost
=
cost
+
hopCost
;
boolean
relaxed
=
newCost
<
oldCost
;
boolean
same
=
Math
.
abs
(
newCost
-
oldCost
)
<
samenessThreshold
;
boolean
same
=
Math
.
abs
(
newCost
-
oldCost
)
<
=
samenessThreshold
;
if
(
same
||
relaxed
)
{
updateVertex
(
v
,
e
,
newCost
,
!
same
);
}
...
...
Please
register
or
login
to post a comment