Millisecond Forums

changing itemprobabilities of list mid-script

https://forums.millisecond.com/Topic20707.aspx

By thv - 2/13/2017

I want to change the itemprobabilities attribute of a list partway through my script. Is there a way to do this?
I tried 
/ ontrialend = [list.times.itemprobabilities = [0.2;0.8;]
and several variations of this but did not have any luck (it did not like the syntax)
By Dave - 2/13/2017

thv - Monday, February 13, 2017
I want to change the itemprobabilities attribute of a list partway through my script. Is there a way to do this?
I tried 
/ ontrialend = [list.times.itemprobabilities = [0.2;0.8;]
and several variations of this but did not have any luck (it did not like the syntax)

The proper syntax to do this would be something like:

<list mylist>
/ items = ("A", "B")
/ itemprobabilities = (0.20; 0.80)
/ poolsize = 10
</list>

<trial mytrial>
/ ontrialbegin = [
    values.myvalue = list.mylist.nextvalue
]
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<values>
/ myvalue = ""
</values>

<text mytext>
/ items = ("<%values.myvalue%>")
</text>

<block more_b>
/ trials = [1-10 = mytrial]
</block>

<block more_a>
/ onblockbegin = [
    list.mylist.itemprobabilities.1 = 0.80;
    list.mylist.itemprobabilities.2 = 0.20;
]

/ trials = [1-10 = mytrial]
</block>

<expt>
/ blocks = [1=more_b; 2=more_a]
</expt>



By thv - 2/13/2017

Dave - Monday, February 13, 2017
thv - Monday, February 13, 2017
I want to change the itemprobabilities attribute of a list partway through my script. Is there a way to do this?
I tried 
/ ontrialend = [list.times.itemprobabilities = [0.2;0.8;]
and several variations of this but did not have any luck (it did not like the syntax)

The proper syntax to do this would be something like:

<list mylist>
/ items = ("A", "B")
/ itemprobabilities = (0.20; 0.80)
/ poolsize = 10
</list>

<trial mytrial>
/ ontrialbegin = [
    values.myvalue = list.mylist.nextvalue
]
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<values>
/ myvalue = ""
</values>

<text mytext>
/ items = ("<%values.myvalue%>")
</text>

<block more_b>
/ trials = [1-10 = mytrial]
</block>

<block more_a>
/ onblockbegin = [
    list.mylist.itemprobabilities.1 = 0.80;
    list.mylist.itemprobabilities.2 = 0.20;
]

/ trials = [1-10 = mytrial]
</block>

<expt>
/ blocks = [1=more_b; 2=more_a]
</expt>




Thanks!!