mackworth - skip count


Author
Message
Tylhi
Tylhi
Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)
Group: Forum Members
Posts: 20, Visits: 121
Hi,

I'm working on a Mackworth script and I do not succeed to fix the number of skip to 15 (we want that the task duration around equal to 15 minutes).
Sometime it works but sometime it doesn't.

You will find attached the script.

Thanks in advance,
Best,
Margaux

Attachments
mackworth15min.iqx (175 views, 47.00 KB)
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K
Tylhi - 3/16/2021
Hi,

I'm working on a Mackworth script and I do not succeed to fix the number of skip to 15 (we want that the task duration around equal to 15 minutes).
Sometime it works but sometime it doesn't.

You will find attached the script.

Thanks in advance,
Best,
Margaux

Be clearer, please. What doesn't work sometimes? Are there too few or too many skips? Does the runtime sometimes exceed 15 minutes (this is expected)?
Tylhi
Tylhi
Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)
Group: Forum Members
Posts: 20, Visits: 121
Hi,

Sorry if I wasn't clear.
What we want it's to have 15 skips, 1 per minute that appear randomly in the minute.
Nevertheless, it happens that we do not have 15 skips as we would but only 13 skips for example (we only have less skips or 15 skips as expected, never more).

Best,
Margaux
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K
Tylhi - 3/16/2021
Hi,

Sorry if I wasn't clear.
What we want it's to have 15 skips, 1 per minute that appear randomly in the minute.
Nevertheless, it happens that we do not have 15 skips as we would but only 13 skips for example (we only have less skips or 15 skips as expected, never more).

Best,
Margaux

Thanks for the clarification. Would you have a data file showing that, please?
Tylhi
Tylhi
Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)
Group: Forum Members
Posts: 20, Visits: 121
Yes I have. 

I attached them to this post.
Attachments
mackworth15min_raw_2.iqdat (176 views, 216.00 KB)
mackworth15min_raw_1.iqdat (187 views, 168.00 KB)
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K
Tylhi - 3/16/2021
Yes I have. 

I attached them to this post.

Thank you.

In essence, the problem is this: The skip times are generated by calculating the average interval between skip events (values.avg_event_interval; that works out to ~56 seconds in your case), constructing an interval around the average (+/- values.max_event_offset; the offset works out to ~50 seconds in your case), and then selecting a random value from within that interval.

With the specific parameter values you have chosen, these intervals overlap substantially. I.e. it is possible for the time generated for the 2nd skip event to end up being before the time generated for the 1st skip event. (Another perhaps desirable, perhaps undesirable for your purposes consequence of this interval overlap is that you may end up with skip events that are relatively close in time to each other.)

Two possible fixes for this:
(1) Make the allowable interval smaller, such that intervals cannot overlap. For example, if you want to allow the average +/- 10 seconds, you could do

<trial GenerateSkipTimes>
/ ontrialbegin = [
    if ( values.current_event_num <= parameters.total_skip_events )
        values.skip_time = values.blockstarttime +
        (values.avg_event_interval*values.current_event_num + rand(-10000, 10000))
    else
        values.skip_time = values.blockendtime;
    
    list.SkipEvent_Time.insertitem(values.skip_time, values.current_event_num);    
    values.current_event_num += 1;
]
...
</trial>

(2) If you're okay with the large interval overlap and some consecutive skip events potentially falling close together in time (a few seconds apart), then you can leave everything as-is and simply sort the skipevent list in ascending order after the generation of the event times:

<trial GenerateSkipTimes>
/ ontrialbegin = [
    if ( values.current_event_num <= parameters.total_skip_events )
        values.skip_time = values.blockstarttime +
        (values.avg_event_interval*values.current_event_num + rand(-1*values.max_event_offset, values.max_event_offset))
    else
        values.skip_time = values.blockendtime;
    
    list.SkipEvent_Time.insertitem(values.skip_time, values.current_event_num);    
    values.current_event_num += 1;
]
/ response = noresponse
/ recorddata = true
/ branch = [
    if (values.current_event_num <= parameters.total_skip_events + 1) {
        return trial.GenerateSkipTimes;
    } else {
        return trial.sortskiplist;
    }
]
</trial>

<trial sortskiplist>
/ ontrialbegin = [
    list.SkipEvent_Time.sort(true, false);
]
/ trialduration = 0
/ validresponse = (0)
/ recorddata = false
</trial>

Edited 4 Years Ago by Dave
Tylhi
Tylhi
Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)Respected Member (426 reputation)
Group: Forum Members
Posts: 20, Visits: 121
Thanks a lot for your answer. 
I will talk about the two options you described with my team to see what they prefer, and then make these changes.

Best,
Margaux
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search