Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Devrim Gunyel
core
Commits
ee212394
Commit
ee212394
authored
Nov 12, 2019
by
Piotr Gawron
Browse files
epsilon in comparison wasn't used everywhere...
parent
bf4d06ce
Changes
4
Hide whitespace changes
Inline
Side-by-side
model/src/main/java/lcsb/mapviewer/model/map/model/ModelComparator.java
View file @
ee212394
...
...
@@ -29,7 +29,7 @@ public class ModelComparator extends Comparator<Model> {
/**
* Default class logger.
*/
private
static
Logger
logger
=
LogManager
.
getLogger
(
ModelComparator
.
class
);
private
static
Logger
logger
=
LogManager
.
getLogger
();
/**
* Epsilon value used for comparison of doubles.
...
...
@@ -38,7 +38,7 @@ public class ModelComparator extends Comparator<Model> {
private
SetComparator
<
SbmlUnit
>
unitSetComparator
=
new
SetComparator
<>(
new
SbmlUnitComparator
());
private
SetComparator
<
Reaction
>
reactionSetComparator
=
new
SetComparator
<>(
new
ReactionComparator
(
epsilon
))
;
private
SetComparator
<
Reaction
>
reactionSetComparator
;
private
ElementUtils
eu
=
new
ElementUtils
();
...
...
@@ -51,6 +51,7 @@ public class ModelComparator extends Comparator<Model> {
public
ModelComparator
(
double
epsilon
)
{
super
(
Model
.
class
);
this
.
epsilon
=
epsilon
;
reactionSetComparator
=
new
SetComparator
<>(
new
ReactionComparator
(
epsilon
));
}
/**
...
...
model/src/main/java/lcsb/mapviewer/model/map/species/ComplexComparator.java
View file @
ee212394
...
...
@@ -88,7 +88,7 @@ public class ComplexComparator extends Comparator<Complex> {
}
}
StructuralStateComparator
structuralStateComparator
=
new
StructuralStateComparator
();
StructuralStateComparator
structuralStateComparator
=
new
StructuralStateComparator
(
epsilon
);
if
(
structuralStateComparator
.
compare
(
arg0
.
getStructuralState
(),
arg1
.
getStructuralState
())
!=
0
)
{
logger
...
...
model/src/main/java/lcsb/mapviewer/model/map/species/ProteinComparator.java
View file @
ee212394
...
...
@@ -59,7 +59,7 @@ public class ProteinComparator extends Comparator<Protein> {
@Override
protected
int
internalCompare
(
Protein
arg0
,
Protein
arg1
)
{
StructuralStateComparator
structuralStateComparator
=
new
StructuralStateComparator
();
StructuralStateComparator
structuralStateComparator
=
new
StructuralStateComparator
(
epsilon
);
StringSetComparator
stringSetComparator
=
new
StringSetComparator
();
if
(
structuralStateComparator
.
compare
(
arg0
.
getStructuralState
(),
arg1
.
getStructuralState
())
!=
0
)
{
...
...
model/src/main/java/lcsb/mapviewer/model/map/species/field/StructuralStateComparator.java
View file @
ee212394
...
...
@@ -4,6 +4,7 @@ import org.apache.logging.log4j.LogManager;
import
org.apache.logging.log4j.Logger
;
import
lcsb.mapviewer.common.Comparator
;
import
lcsb.mapviewer.common.Configuration
;
import
lcsb.mapviewer.common.comparator.*
;
import
lcsb.mapviewer.model.map.MiriamData
;
...
...
@@ -15,13 +16,23 @@ import lcsb.mapviewer.model.map.MiriamData;
*/
public
class
StructuralStateComparator
extends
Comparator
<
StructuralState
>
{
/**
* Epsilon value used for comparison of doubles.
*/
private
double
epsilon
;
private
static
Logger
logger
=
LogManager
.
getLogger
();
/**
* Default constructor.
*/
public
StructuralStateComparator
()
{
this
(
Configuration
.
EPSILON
);
}
public
StructuralStateComparator
(
double
epsilon
)
{
super
(
StructuralState
.
class
);
this
.
epsilon
=
epsilon
;
}
@Override
...
...
@@ -30,7 +41,7 @@ public class StructuralStateComparator extends Comparator<StructuralState> {
if
(
stringComparator
.
compare
(
arg0
.
getValue
(),
arg1
.
getValue
())
!=
0
)
{
return
stringComparator
.
compare
(
arg0
.
getValue
(),
arg1
.
getValue
());
}
PointComparator
pointComparator
=
new
PointComparator
();
PointComparator
pointComparator
=
new
PointComparator
(
epsilon
);
if
(
pointComparator
.
compare
(
arg0
.
getPosition
(),
arg1
.
getPosition
())
!=
0
)
{
logger
.
debug
(
"position different: "
+
arg0
.
getPosition
()
+
", "
+
arg1
.
getPosition
());
return
pointComparator
.
compare
(
arg0
.
getPosition
(),
arg1
.
getPosition
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment