x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to make random sequence of one condition x times and another condition y times

I want to to run a trial (sequences of blueprint scripts) with two different possible conditions (one condition in 28 of the trials the other 132 trials) 160 times in a random sequence. I have no problem setting up the trial routines in blueprints and making it repeat itself 160 times randomly choosing one or the other condition each trial (branch with random bool stream as condition).

BUT what I can't figure out is how I should go about making it so that the trial is run 160 times in a random order but with specifically 28 repitions of condition x and 132 repitions of condition y?

Hope I am clear enough and thanks for being a really, really helpful community!

Product Version: Not Selected
Tags:
more ▼

asked Aug 22 '14 at 02:27 PM in Blueprint Scripting

avatar image

4everwilliam
6 3 5 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

6 answers: sort voted first

Hey 4everwilliam-

One solution would be to add a tracker to each of your conditions (x and y) to track how many times each one has triggered. Assuming you're using a loop to trigger each of the 160 repetitions, after randomly selecting the condition you then check to see if it has run its maximum number of times allowed (as set by the tracker) and, if so, to then run the opposite condition. Hope this helps solves your problem and good luck with your project.

Cheers

Doug Wilson

more ▼

answered Aug 22 '14 at 02:48 PM

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hi Doug,

thanks for the reply. Unfortunately your suggested sollution will not work for me since it would not lead to a completely random sequence of trials. Your suggestion would makes it much more likely for condition x (28 trials) to appear early in the sequence since they have a 0.5 chance of getting choosen each time.

Kind regards

more ▼

answered Aug 24 '14 at 07:25 AM

avatar image

4everwilliam
6 3 5 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hello again

Could you provide a bit more information to help me understand exactly what you are trying to do? It sounds like you want condition y (132 trials) to have a slightly higher chance of getting chosen with each run than condition x. Assuming this is the case you could try adding a random integer node that picks a number in a given range (from 0 to the max number of trials). If the number chosen is above a certain threshold then you can run one condition, otherwise run the other. Below is an image to show what I mean.

alt text

randomnumber.png (32.3 kB)
more ▼

answered Aug 25 '14 at 02:39 PM

avatar image 4everwilliam Aug 25 '14 at 04:52 PM

I will run a trial sequence with two conditions 160 times. I want 132 trials to be condition x and 28 trials be condition y. However I need the order of the trials to be completely random. So before each trial, one trial out of all the remaining trials not yet performed will be chosen randomly, and each time this happens every one of the remaining variants trials should have an equal chance of getting drawn.

Somehow I missed the random integer node. I see now how this could be done by updating the random integer max value and treshholds every draw, adjusting the odds according to number of remaining trials for each trial condition. Next time I work on my project I will try and do this.

Thank you!

avatar image Doug E ♦♦ STAFF Aug 25 '14 at 05:56 PM

Glad to be of help and good luck with your project.

Cheers

Doug Wilson

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

It's amazing, I'm glad I read it. Super news rolling sky

more ▼

answered Apr 10 '18 at 09:35 AM

avatar image

ellascottgm12345
1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

This setting allow to set our clock in your window system and here set clocks by the help of some technique we can organize our time.

more ▼

answered Oct 15 '18 at 01:02 PM

avatar image

vedantydv
1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

This website is very good and nice photoshop tutorial,please check the impossible quiz

more ▼

answered Mar 25 '19 at 02:06 AM

avatar image

galken1
1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question