-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#1570 Add degree range evolution operator #1582
base: develop
Are you sure you want to change the base?
Conversation
@Before | ||
public void setUp() throws Exception { | ||
testGraph = getTestGraphWithValues(); | ||
Collection<Tuple2<GradoopId, String>> idLabelCollection = new HashSet<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you need this ?
opt = vertexDegrees.values().stream().reduce(Math::max); | ||
opt.ifPresent(integer -> collector.collect(new Tuple2<>(timePoint, integer))); | ||
break; | ||
case AVG: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not belong in this Branch
case RANGE: | ||
opt = vertexDegrees.values().stream().reduce(Math::max); | ||
opt2 = vertexDegrees.values().stream().reduce(Math::min); | ||
opt.flatMap(max -> opt2.map(min -> max - min)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not working. It does not change the value of the opt. Since the expected values in the UnitTests are wrong for BOTH, t4, you were possibly not aware of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int maxDegree = vertexDegrees.values().stream().reduce(Math::max).orElse(0);
int minDegree = vertexDegrees.values().stream().reduce(Math::min).orElse(0);
collector.collect(new Tuple2<>(timePoint, maxDegree - minDegree));
// DEGREES | ||
EXPECTED_BOTH_DEGREES.add(new Tuple2<>(Long.MIN_VALUE, 0)); | ||
EXPECTED_BOTH_DEGREES.add(new Tuple2<>(0L, 1)); | ||
EXPECTED_BOTH_DEGREES.add(new Tuple2<>(4L, 3)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expected value should be 2 here, since max is 3 and min is 1.
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Types of Changes
Checklist: