Caveat lector, my subject line may be inappropriate for the question below, but it seems to come the closest to my understanding (http://en.wikipedia.org/wiki/Overlapping_generations_model).

Update: The above link to modeling financial instruments may be confusing, but the following sentence from the above link resonated with me, "model in which agents live a finite length of time and live long enough to endure into at least one period of the next generation's lives."

I am looking for a way to model overlapping generations where 'a' lies within 'b' which starts in 'c' and ends in 'd' whereby 'c' lies within 'e' and so on. Here is my attempt to draw it in ascii

+-- | +-- | | |d +--- a--+ b | | | --+--+ +-- | | |c |e | | +--| +---

Update: Here is a real example: geologic time is made up of opinions. "The opinion is that the given level in a section at a locality corresponds to zone G. When this is compared to other opinions, it will come out that zone G is in the regional Tulean stage. When that is compared to other opinions, it will come out that the Tulean straddles the Tremadoc and Arenig. But the Arenig spans the Floian through lower Darriwilian. So, without the proper precautions, one could end up thinking the level in the section is somewhere between the Tremadoc and Darriwilian, when in fact it is much better constrained than that."

It could be done in SQL, and that is how we are tackling it right now, but it is messy, and the coding is always complicated. I am thinking of alternatives, perhaps as graphs (RDF triples), or some other way.

I am sure knowledgable monks will have several ideas. I look forward to your thoughts.

Update 2: Set::IntervalTree looks very promising.



when small people start casting long shadows, it is time to go to bed

In reply to modeling overlapping generations by punkish

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.