# Mworks selection variable

**URL:** <https://mworks.discourse.group/t/mworks-selection-variable/614>\
**Category:** Support\
**Created:** [September 17, 2013, 1:20pm UTC](https://mworks.discourse.group/t/mworks-selection-variable/614 "2013-09-17T13:20:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 17, 2013, 1:20pm UTC](https://mworks.discourse.group/t/mworks-selection-variable/614/1 "2013-09-17T13:20:17Z")

</div>

Hi Chris,  
I’m having a weird issue with selection variables in mworks. I’ve defined a trial id selection variable which takes one of 560 values, and am extracting trial variables (stimulus location and category) from it. I’m doing this so that I have blocks of 560 trials in which I can control/balance the number of trials per stimulus condition. For instance, when the monkey aborts a trial, the last selection is rejected, while when the monkey completes a trial, it is accepted. What is happening instead is that the trial id is getting read out of the selection variable correctly for a while (several hundred trials), and suddenly, for every trial, the selection variable value is the same. However, the number of possible values has not yet been reached (i.e. trial number is \< 560). Do you have any idea why it would get stuck in this way?  
Thanks,  
Rishi

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 17, 2013, 1:48pm UTC](https://mworks.discourse.group/t/mworks-selection-variable/614/2 "2013-09-17T13:48:33Z")

</div>

Hi Rishi,

> Do you have any idea why it would get stuck in this way?

Nothing comes to mind, but it certainly could be a bug. Can you send me a copy of your experiment so I can figure out what’s going on?

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 17, 2013, 3:38pm UTC](https://mworks.discourse.group/t/mworks-selection-variable/614/3 "2013-09-17T15:38:17Z")

</div>

Hi Chris,  
See attached mworks file. I’ve also pasted an example list of selected IDs  
(inferred from the stimulus selections), so you can tell that it gets stuck  
at some point.  
Thanks,  
Rishi

EX: 15060, 12050, 4030, 12010, 4060, 15040, 4000, 6050, 6000, 15060, 6030,  
2060, 16010, 14030, 16020, 12000, 13070, 4050, 5000, 16030, 6070, 4050,  
4000, 14020, 12060, 12060, 6010, 12060, 6000, 4060, 12060, 15010, 40,  
15000, 16020, 6020, 16010, 12070, 16020, 40, 2010, 4070, 5000, 14060,  
11030, 2030, 4030, 4020, 4020, 6040, 2040, 4030, 4010, 16020, 14000, 10060,  
11060, 11060, 6050, 16010, 4050, 16070, 1060, 4000, 14000, 1040, 1020,  
6010, 4030, 6030, 14070, 15070, 6000, 2040, 6050, 2070, 4000, 60, 14070,  
16030, 4070, 5010, 6070, 4070, 6010, 13010, 10050, 50, 4010, 12050, 6000,  
2030, 17030, 10050, 14000, 12000, 16040, 14020, 2000, 6030, 16000, 14030,  
7010, 11060, 2070, 6040, 6050, 6010, 12000, 2050, 2010, 7050, 6020, 2050,  
15000, 1020, 16040, 7020, 2060, 12070, 2030, 6030, 6010, 1060, 4000, 6070,  
3060, 10060, 12010, 4050, 16030, 2030, 10, 15020, 7010, 6050, 12070, 1020,  
10030, 14020, 2030, 50, 14010, 12060, 30, 2010, 4010, 7000, 11020, 4010,  
2000, 10, 11070, 17040, 2050, 12040, 2010, 10040, 6000, 16050, 12040, 7020,  
7040, 13060, 10030, 7030, 10060, 16070, 7050, 10020, 14050, 17020, 11070,  
16050, 16010, 6040, 10020, 1000, 17000, 16000, 14050, 1050, 12000, 17040,  
4010, 17060, 11040, 4020, 16030, 10060, 10040, 30, 12030, 12030, 14010,  
1000, 7050, 10, 16030, 16010, 10020, 7040, 6020, 5070, 11030, 5060, 3040,  
15060, 15040, 5040, 5070, 11020, 10010, 5020, 13000, 14070, 14070, 14070,  
4030, 13060, 16050, 3020, 5040, 5020, 1030, 15030, 5040, 15020, 12030,  
10010, 16050, 4050, 16070, 12070, 12050, 2040, 70, 10070, 11020, 11050,  
15030, 4060, 12040, 14020, 7040, 7010, 13040, 1020, 10070, 11060, 3010,  
17000, 11040, 5030, 14010, 15070, 5000, 15010, 17000, 10030, 13040, 1050,  
2040, 14000, 14000, 30, 10040, 4070, 15030, 13020, 7010, 3020, 17020,  
15000, 5070, 5040, 11020, 5070, 7000, 7000, 15040, 17030, 1030, 7040,  
17050, 60, 7030, 50, 6020, 17030, 6020, 11030, 3020, 12010, 3060, 1070,  
3040, 1070, 13000, 11070, 7030, 14030, 13050, 11050, 13060, 20, 13060,  
7000, 7050, 6040, 1040, 11050, 11050, 11050, 11050, 11050, 11050, 11050,  
11050, 11050, 11050, 11050, 11050, 11050, 11050, 11050, 11050, 11050,  
11050, 11050, 11050, 11050, 11050, 11050, 11050, 11050, 11050, 11050,  
11050, 11050, 11050, 11050, 11050, 11050, 11050, 11050, 11050, 11050,  
11050, 11050, 11050, 11050, 11050, 11050, 11050, 11050, 11050, 11050,  
11050, 11050, 11050, 11050, 11050, 11050, 11050, 11050

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 23, 2013, 2:29pm UTC](https://mworks.discourse.group/t/mworks-selection-variable/614/4 "2013-09-23T14:29:24Z")

</div>

Hi Rishi,

As we discussed offline, I believe the issue here is a difference in behavior between accept\_selections and reject\_selections. Specifically, reject\_selections implicitly calls next\_selection, while accept\_selections does not. Therefore, instead of unconditionally calling next\_selection at the start of each trial, you should instead call next\_selection only after accept\_selections.

Has making this change resolved the issue for you?

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 23, 2013, 4:56pm UTC](https://mworks.discourse.group/t/mworks-selection-variable/614/5 "2013-09-23T16:56:18Z")

</div>

Hi Chris,  
Yes, this resolved the issue. Thanks again!  
Best  
Rishi

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 19, 2022, 11:26pm UTC](https://mworks.discourse.group/t/mworks-selection-variable/614/6 "2022-07-19T23:26:57Z")

</div>

Closed on July 19, 2022, 11:26pm UTC


