Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Randomize just part of a Block

Hey guys, I want to ask how to randomise just a part of blocks in each group.

The following code includes no randomisation. I want to randomise always the midline but just that line nothing else. Means Block 1 and 2 for the first and second scenario and Block 6 and 7 for the third and fourth.

I tried to insert RANDOMIZE() like this way:
...
ADD(RANDOMIZE("BlockList",1,2));
...

but it doesn't work. Any ideas?

Begin Unverified Perl
    if(VALUE("QuotaGroups")==1)
    {
        ADD("BlockList",3);
        ADD("BlockList",1,2);
        ADD("BlockList",5);
    }
    elsif(VALUE("QuotaGroups")==2)
    {
        ADD("BlockList",4);
        ADD("BlockList",1,2);
        ADD("BlockList",5);
    }
    elsif(VALUE("QuotaGroups")==3)
    {
        ADD("BlockList",8);
        ADD("BlockList",6,7);
        ADD("BlockList",10);
    }
    else
    {
        ADD("BlockList",9);
        ADD("BlockList",6,7);
        ADD("BlockList",10);
    }
End Unverified
asked Jan 21 by Honeybadger Bronze (890 points)
Have you tried the version of RANDOMIZE that allows you to specify startindex and endindex? In your first block of instructions, under your         ADD("BlockList",1,2); you'd add RANDOMIZE(2,3); to randomize the 2nd and 3rd items currently on the list, which in this case would be items 1 and 2.
Thanks. It works fine!

Your solution to the original question

Please only use this to answer the original question. Otherwise please use comments.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

To avoid this verification in future, please log in or register.
...