Thursday, 22 August 2013

Algorithm - Manipulating a set of date/time objects to get a specific set

Algorithm - Manipulating a set of date/time objects to get a specific set

I have working on a algorithm that select a set of date/hour objects with
a certain characteristic, but with no success.
First, It could be helpful if you can see my data objects:
2013-07-18 10:55:00
2013-07-18 11:16:00
2013-07-18 12:02:00
2013-07-18 12:39:00
2013-07-18 13:14:00
2013-07-18 13:50:00
2013-07-19 11:30:00
2013-07-19 12:00:00
2013-07-19 12:46:00
2013-07-19 13:19:00
2013-07-22 11:36:00
2013-07-22 12:21:00
2013-07-22 12:48:00
2013-07-22 13:26:00
2013-07-23 11:18:00
2013-07-23 11:48:00
2013-07-23 12:30:00
2013-07-23 13:12:00
2013-07-24 11:18:00
2013-07-24 11:42:00
2013-07-24 12:20:00
2013-07-24 12:52:00
2013-07-24 13:29:00

These data are in a list of date/hour objects.
What is the problem? I need a set of nearest date/hour objects. Each hour
of this set must come from different days.
For example: [2012-09-09 12:00,2012-09-10 12:00, 2012-09-11 12:00]
This example of a set of date/hour objects is the best example because it
minimize to zero.
Trying to contextualize this: I want to observe if a phenomenon occurs at
the same hour in differents days. If not, I want to evaluate if distance
between the hours is reasonable for my study.
I would like a generic algorithm to any number of days and hours. And I am
not worried with perfomance a priori.
Hope that you can help me! (:

No comments:

Post a Comment