FlowModel
If the optional Flow parameter is set, the names of expression definitions must be listed that should be executed to form the execute the flow model:
Format: ExpressionName_1
ExpressionName_2.
..
Example of classifying a mouse click into ‘far’ vs. ‘near’ from target location
EXPRESSION CheckDist
ifelse(get_rsp('dist') > 5, 'far', 'near')
TRIAL T1
TL Circle KeyTbl 10 0
RK Press
SP Target Circle ? 0 1
OE CheckDist
far: SP Far Center(1) 1000
near: SP Near Center(1) 1000
Example of updating MaxRt to 1.5 of the standard deviation of all response latencies
VARIABLE MaxRt 2000
EXPRESSION UpdateMaxRt
@MaxRt = get_blk('mean_rt') + (1.5 * get_blk('sd_rt'))
TRIAL T1
…
EX UpdateMaxRt
RK Press MaxRt
SP Target Circle ? 0 1
Example of displaying last reaction time
Variable RT
PICTURE LastRT T
Your last RT was @vRT@ msec
EXPRESSION GetLastRt
@RT = get_rsp('rt')
@RT = numform(@RT, 3, 4)
TRIAL T1
RK -
SP Press Circle 1 0 1
EX GetLastRt
SP LastRT Center 1 2000
Example of a flow model which generated two different random numbers
Variable rnd1
Variable rnd2
EXPRESSION GenRndNumbers
@rnd1 = random(10)
@rnd2 = random(10)
EXPRESSION isEqualNumbers
@rnd1 == rnd2
EXPRESSION GetNumbers DOWHILE
GenRndNumbers ; DO GenRndNumbers
isEqualNumbers ; WHILE (isEqualNumbers)
TRIAL Sample
EX GetNumbers ; generate two different numbers
Copyright 2023 - BeriSoft Inc.
All rights reserved