Re: [gephi-dev] Can one merge two DynamicInteger instances in a third one?

1 view
Skip to first unread message

Cezary Bartosiak

unread,
Oct 4, 2015, 10:53:15 AM10/4/15
to geph...@lists.gephi.org
Well, there is no any merge method now. But you can create new DynamicInteger that will contain intervals from the first variable and the second one. You can do this this way:

// di1 - the first variable
// di2 - the second variable

// 1st way:

DynamicInteger di3 = new DynamicInteger(di1, di2.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY));

// endpoints are included by default, but you can use getIntervals(Interval interval),
// which lets you specify if endpoints should be included or excluded

// 2nd way:

DynamicInteger di3 = (DynamicInteger)DynamicUtilities.createDynamicObject( 
   AttributeType.DYNAMIC_INT, 
   di1, 
   di2.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY)
);

PS. I'll be offline til Monday.

On 3 December 2010 11:02, Sébastien Heymann <sebastie...@gephi.org> wrote:
Hello @dev,

I don't find a proper method to merge two DynamicInteger objects. My use case:

I execute a dynamic statistic for a particular time window, and I get a DynamicInteger object containing my results.
Then I execute it again but on the next time window, so I get another DynamicInteger object.

I want to merge the two results in a single object. How is it possible:
- if there is no time overlap?
- if there is time overlap?

Thanks,
Seb

_______________________________________________
gephi-dev mailing list
geph...@lists.gephi.org
http://gephi.org/mailman/listinfo/gephi-dev


Sébastien Heymann

unread,
Oct 4, 2015, 10:53:17 AM10/4/15
to geph...@lists.gephi.org

Mathieu Bastian

unread,
Oct 4, 2015, 11:15:52 AM10/4/15
to geph...@lists.gephi.org
I believe we need a better Utility package for manipulating intervals:
- add
- remove (only the exact interval given)
- removeAll (all intervals in the window)
- union
- intersection
- difference

The fact we have all different types make this task challenging but a solution should exist

On Fri, Dec 3, 2010 at 4:33 AM, Sébastien Heymann <sebastie...@gephi.org> wrote:
Hmm, it doesn't work, because createDynamicObject() clones only di1:


DynamicInteger di3 = new DynamicInteger(di1, di2.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY));
Fills di3 with the content of di1 restricted by the intervals of di2.

What I need is:
public static DynamicType createDynamicObject(AttributeType type, DynamicType source1, DynamicType source2, Interval in, Interval out)


It is clear that the support of Dynamics in Gephi still needs strong improvements to be usable in a real-world scenario. So I'll separate now my regular work (which will be made dirty due to time constraints, so bad...) and the contributions I will have on this part of Gephi.

Cezary & Mathieu, I propose to switch to a private email thread now to discuss on how to achieve this work: I have use cases, you have the vision and know how it is implemented. Let's make pop-corn now :)

Seb


2010/12/3 Sébastien Heymann <sebastie...@gephi.org>

Okay, thanks!

Seb

2010/12/3 Cezary Bartosiak <cezary.b...@gmail.com>

Sébastien Heymann

unread,
Oct 4, 2015, 11:15:52 AM10/4/15
to Cezary Bartosiak, geph...@lists.gephi.org
Hmm, it doesn't work, because createDynamicObject() clones only di1:

DynamicInteger di3 = new DynamicInteger(di1, di2.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY));
Fills di3 with the content of di1 restricted by the intervals of di2.

What I need is:
public static DynamicType createDynamicObject(AttributeType type, DynamicType source1, DynamicType source2, Interval in, Interval out)


It is clear that the support of Dynamics in Gephi still needs strong improvements to be usable in a real-world scenario. So I'll separate now my regular work (which will be made dirty due to time constraints, so bad...) and the contributions I will have on this part of Gephi.

Cezary & Mathieu, I propose to switch to a private email thread now to discuss on how to achieve this work: I have use cases, you have the vision and know how it is implemented. Let's make pop-corn now :)

Seb


2010/12/3 Sébastien Heymann <sebastie...@gephi.org>
Okay, thanks!

Seb

2010/12/3 Cezary Bartosiak <cezary.b...@gmail.com>

Sébastien Heymann

unread,
Oct 4, 2015, 11:15:52 AM10/4/15
to Cezary Bartosiak, geph...@lists.gephi.org
Okay, thanks!

Seb

2010/12/3 Cezary Bartosiak <cezary.b...@gmail.com>
Well, there is no any merge method now. But you can create new DynamicInteger that will contain intervals from the first variable and the second one. You can do this this way:
Reply all
Reply to author
Forward
0 new messages