Random location
Tony Zuccolotto
anthony.zuccolotto at pstnet.com
Tue Nov 12 16:52:33 UTC 2002
Norman,
E-Prime has a random number generator built in which all List objects
within an experiment use automatically, so typically you don't have to
worry about it and you just setup whatever List you are using to sample
randomly and it will randomize your stimuli.
If you need some type of "custom randomization" (e.g. an ordering that
is perhaps "tuned on the fly") then you can do that through some
scripting in an Inline object. Under this scenario you can use the
ExplicitOrder object, construct a string that represents the ordering of
all the exemplars you want to use, and then have the List object use the
ExplicitOrder object it at runtime. Note, that ExplicitOrder object is
available only via script but a simple example is shown in the E-Basic
help to outline how to use it.
Alternatively you could write out a file at runtime and have the List
object load the stimuli dynamically (i.e. you can read a list of
stimuli, set a specific ordering through whatever algorithm you choose,
write the list to a file on disk, and then have the List object read in
the stimuli before it runs and present them in sequential order).
If you just need to generate a random number between two integer limits
you can use the Random(min,max) function. If you want direct access to
the built in Pseudo Random Number Generator you can use the methods of
the PRNG object to generate random numbers in the range of 0.0 to 1.0.
If all else fails you can theoretically implement your own random number
generator by expressing/implementing the algorithm in E-Basic. The
only limitation currently is that you cannot directly replace the PRNG
object (although that feature is being considered for a future version
of E-Prime).
If for some reason the E-Basic language was insufficient to express the
algorithm you wish to use (which highly unlikely), you can always create
a DLL (using C/C++ or a language of your choosing) and then use the
DECLARE statement to make the external routine callable by E-Basic
script at runtime.
You should be able to get more information about all of the object and
functions mentioned above via the E-Basic Help.
Regards,
Tony
*** DISCLAIMER: VIEWS EXPRESSED ARE MY OWN AND DO NOT NECESSARILY
REFLECT THOSE OF MY EMPLOYER ***
Anthony P. Zuccolotto
Vice President of Operations
Psychology Software Tools, Inc.
2050 Ardmore Boulevard Suite 200
Pittsburgh, PA 15221-4610
Phone 412-271-5040
FAX 412-271-7077
Email anthony.zuccolotto at pstnet.com
Internet http://www.pstnet.com
> -----Original Message-----
> From: Norman E. Kinney [mailto:norm at kinney.semo.edu]
> Sent: Tuesday, November 12, 2002 9:03 AM
> To: Tony Zuccolotto
> Subject: RE: Random location
>
> Tony - how would you set up a random number generator in e-prime?
Thanks.
>
>
More information about the Eprime
mailing list