Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
YoshikoWrapper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Philipp Spohr
YoshikoWrapper
Commits
41c9ae92
Commit
41c9ae92
authored
7 years ago
by
Philipp Spohr
Browse files
Options
Downloads
Patches
Plain Diff
Missing sanity check
parent
05c61ee2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/hhu/ba/yoshikoWrapper/core/NetworkParser.java
+11
-11
11 additions, 11 deletions
...ain/java/de/hhu/ba/yoshikoWrapper/core/NetworkParser.java
with
11 additions
and
11 deletions
src/main/java/de/hhu/ba/yoshikoWrapper/core/NetworkParser.java
+
11
−
11
View file @
41c9ae92
...
@@ -39,14 +39,18 @@ public class NetworkParser {
...
@@ -39,14 +39,18 @@ public class NetworkParser {
//Loop over edges
//Loop over edges
for
(
CyEdge
e
:
edges
)
{
for
(
CyEdge
e
:
edges
)
{
CyRow
edgeEntry
=
net
.
getRow
(
e
);
//Parse editing costs
//Parse editing costs
double
weight
=
deletionCostDefault
;
double
weight
=
deletionCostDefault
;
//Fetch entry and check if it exists
CyRow
edgeEntry
=
net
.
getRow
(
e
);
//Check if there is a weight column defined, else skip
if
(
weightColumn
!=
null
){
if
(
weightColumn
!=
null
){
System
.
out
.
println
(
"Using column: "
+
weightColumn
.
getName
());
//Check if the column contains an entry for the respective edge
try
{
//It is possible, that there are missing entries
//Find out if the weights are double or int
if
(
edgeEntry
.
getAllValues
().
containsKey
(
weightColumn
.
getName
())){
//Find out if the weights are double or integer and cast accordingly
Class
<?>
weightType
=
weightColumn
.
getType
();
Class
<?>
weightType
=
weightColumn
.
getType
();
if
(
weightType
==
Integer
.
class
)
{
if
(
weightType
==
Integer
.
class
)
{
weight
=
(
int
)
edgeEntry
.
get
(
weightColumn
.
getName
(),
weightType
);
weight
=
(
int
)
edgeEntry
.
get
(
weightColumn
.
getName
(),
weightType
);
...
@@ -54,11 +58,7 @@ public class NetworkParser {
...
@@ -54,11 +58,7 @@ public class NetworkParser {
else
if
(
weightType
==
Double
.
class
)
{
else
if
(
weightType
==
Double
.
class
)
{
weight
=
(
double
)
edgeEntry
.
get
(
weightColumn
.
getName
(),
weightType
);
weight
=
(
double
)
edgeEntry
.
get
(
weightColumn
.
getName
(),
weightType
);
}
}
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
//Invalid entry (no entry)
logger
.
info
(
"No valid edit costs defined for: "
+
edgeEntry
.
get
(
"name"
,
String
.
class
)+
", falling back to default value!"
);
}
}
}
}
...
...
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