Click here to Skip to main content
15,354,822 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: My brain hurts: overlapping range lists Pin
honey the codewitch30-Dec-21 9:34
mvahoney the codewitch30-Dec-21 9:34 
GeneralRe: My brain hurts: overlapping range lists Pin
ElectronProgrammer30-Dec-21 10:35
MemberElectronProgrammer30-Dec-21 10:35 
GeneralRe: My brain hurts: overlapping range lists Pin
honey the codewitch30-Dec-21 11:18
mvahoney the codewitch30-Dec-21 11:18 
GeneralRe: My brain hurts: overlapping range lists Pin
Super Lloyd30-Dec-21 9:30
MemberSuper Lloyd30-Dec-21 9:30 
GeneralRe: My brain hurts: overlapping range lists Pin
honey the codewitch30-Dec-21 9:32
mvahoney the codewitch30-Dec-21 9:32 
GeneralRe: My brain hurts: overlapping range lists Pin
Super Lloyd30-Dec-21 10:22
MemberSuper Lloyd30-Dec-21 10:22 
GeneralRe: My brain hurts: overlapping range lists Pin
honey the codewitch30-Dec-21 11:17
mvahoney the codewitch30-Dec-21 11:17 
GeneralRe: My brain hurts: overlapping range lists Pin
Super Lloyd30-Dec-21 11:22
MemberSuper Lloyd30-Dec-21 11:22 
your answer confuses me, it looks like you haven't read the code (lack of sleep perhaps?), or I misunderstand the question (lack of sleep on my part perhaps).

Because the code quite obviously merge overlap range on insert so... could you be more clear on what's wrong?
For clarity I paste the add method again below with added comment
C#
public void Add(FATransition item)
{
    int start = FindIndex(item.Min);
    for (int i = _transitions.Count - 1; i >= start; i--)
    {
        var t = _transitions[i];
        if (t.To == item.To && t.Min <= item.Max)
        {
            // !!! IMPORTANT !!!
            // this merge the previous range in current range and remove it
            // so only merged range will be left
            // !!! WHY IS IT INSUFFICIENT ???
            item.Max = t.Max;
            _transitions.RemoveAt(i); 
        }
        else if (t.To != item.To && t.Min <= item.Max && t.Max > item.Min)
        {
            IsDeterministic = false;
        }
    }
    _transitions.Insert(start, item);
}
A new .NET Serializer
All in one Menu-Ribbon Bar
Taking over the world since 1371!

GeneralRe: My brain hurts: overlapping range lists Pin
honey the codewitch30-Dec-21 11:32
mvahoney the codewitch30-Dec-21 11:32 
GeneralRe: My brain hurts: overlapping range lists Pin
Super Lloyd30-Dec-21 11:36
MemberSuper Lloyd30-Dec-21 11:36 
GeneralRe: My brain hurts: overlapping range lists Pin
Super Lloyd30-Dec-21 10:29
MemberSuper Lloyd30-Dec-21 10:29 
GeneralRe: My brain hurts: overlapping range lists Pin
ElectronProgrammer30-Dec-21 9:35
MemberElectronProgrammer30-Dec-21 9:35 
GeneralRe: My brain hurts: overlapping range lists Pin
Gerry Schmitz30-Dec-21 9:51
mveGerry Schmitz30-Dec-21 9:51 
GeneralRe: My brain hurts: overlapping range lists Pin
honey the codewitch30-Dec-21 9:55
mvahoney the codewitch30-Dec-21 9:55 
GeneralRe: My brain hurts: overlapping range lists Pin
Gerry Schmitz30-Dec-21 10:05
mveGerry Schmitz30-Dec-21 10:05 
GeneralRe: My brain hurts: overlapping range lists Pin
honey the codewitch30-Dec-21 11:14
mvahoney the codewitch30-Dec-21 11:14 
GeneralRe: My brain hurts: overlapping range lists Pin
0x01AA30-Dec-21 11:20
professional0x01AA30-Dec-21 11:20 
GeneralRe: My brain hurts: overlapping range lists Pin
honey the codewitch30-Dec-21 11:37
mvahoney the codewitch30-Dec-21 11:37 
GeneralRe: My brain hurts: overlapping range lists Pin
Gerry Schmitz30-Dec-21 19:06
mveGerry Schmitz30-Dec-21 19:06 
GeneralRe: My brain hurts: overlapping range lists Pin
Randor 30-Dec-21 11:49
professional Randor 30-Dec-21 11:49 
GeneralRe: My brain hurts: overlapping range lists Pin
honey the codewitch30-Dec-21 12:05
mvahoney the codewitch30-Dec-21 12:05 
GeneralRe: My brain hurts: overlapping range lists Pin
englebart1-Jan-22 9:11
professionalenglebart1-Jan-22 9:11 
JokeWhat spice does Satan use..–––––WARNING: WILL CAUSE EYE ROLLING... Sorry the last one was so late yesterday... Pin
oofalladeez34330-Dec-21 7:49
professionaloofalladeez34330-Dec-21 7:49 
GeneralRe: What spice does Satan use..–––––WARNING: WILL CAUSE EYE ROLLING... Sorry the last one was so late yesterday... Pin
OriginalGriff30-Dec-21 8:38
mveOriginalGriff30-Dec-21 8:38 
GeneralRe: What spice does Satan use..–––––WARNING: WILL CAUSE EYE ROLLING... Sorry the last one was so late yesterday... Pin
oofalladeez34330-Dec-21 9:43
professionaloofalladeez34330-Dec-21 9:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

What language are you using for AI development or learning?
Whether you're at work or home, hard core coding or just trying to figure out this AI thing, which languages have you used in your adventures?
  Results   474 votes