Possible caseIndex bug in Sampler?

Tags:
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #891 Score: 0
    hasenbaj@gmail.com
    Participant

    Can you help me understand why my use of the ‘caseIndex’ attribute is not working in this simulation?

    https://codap.concord.org/app/#shared=98506

    The issue is that this command in the Samples table:

    if(first(caseIndex,value=”A”)4,
    first(caseIndex,value=”A”),”4+”)

    always returns “4+”, as if the conditional argument is false.

    My workaround was to define an attribute called ‘myindex’ in the Items table whose formula is simply ‘caseIndex’. With that change, the following command works as intended in the Samples table:

    if(first(myindex,value=”A”)<4,
    first(myindex,value=”A”),”4+”)

    Am I doing something wrong? Seems like this might be a bug…

    (Related: I noticed whenever I clear the data to run the simulation again, the ‘myindex’ attribute is deleted from the Items table and I have to recreate it. Is that intended behavior?)

    #892
    Bill Finzer
    Keymaster

    Definitely a bug! And you get first call on it. Thanks very much. And nice workaround.

    Deleting the measures on Clear Data was by design with the idea that you would be moving on to a new model-making activity. But you’re not the first to wish it were different, so perhaps we’ll rethink. A workaround is to use “Delete All Cases” in the table menu as that leaves all the attributes intact.

    #895
    Jonathan Sandoe
    Keymaster

    The API document says the first argument must be an attribute. “caseIndex” is a generated value, not quite a proper attribute of the case. That is probably why it is failing, though, I agree, it should be fixed.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.