AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Any way to randomly iterate a set?
 
 

Like the test screen shows, if I’m correct, ^pick may always miss to get some members in consecutive rounds of picking. And ^iterator is one way sequential.

Is there any way to sort of iterating a set randomly, meaning to get randomly different iterations of a set in different runs?

Many thanks.

Image Attachments
CS_iterator.png
 

 
  [ # 1 ]

Clearly for each of your pick calls, you did get randomly different iterations in those runs, so what is it that you are asking?  And pick does not always miss getting some members despite your random evidence above

 

 
  [ # 2 ]

Maybe what you want is an exhausting random walk thru a set.  Sets cannot be exhausted, but you can do this:
query(direct_vo ? member ‘~val)
loop(15) {pick(@0subject)}

 

 
  [ # 3 ]

Yes what I want is exhausting random walk, while in that test the pick actually was circulating thru a “fix sequence” of 10 of the elements leaving the remaining 5 untouched.

Thank you for advising the fact/query solution. I’ll see how I can understand it.

 

 
  [ # 4 ]

Actually I wouldnt describe it as circulating thru a fixed sequence of 10.  In fact if you ran the test more iterations, you would have seen ones you hadn’t seen before.

 

 
  [ # 5 ]

Right. I believe so. But a major concern is that the set needs to be exhausted. In that sense I will try learning the query approach.

Many thanks.

 

 
  [ # 6 ]
Bruce Wilcox - May 18, 2015:

Maybe what you want is an exhausting random walk thru a set.  Sets cannot be exhausted, but you can do this:
query(direct_vo ? member ‘~val)
loop(15) {pick(@0subject)}

I’m trying to do it but found that the randomizing of pick() sort of initialized itself in a fixed way at topic start, and I could get a different random sequence only after some user input. (Please refer to the test script and screen shot attached.)

But my requirement is to present a different random sequence at the start of a topic, before any user input.

Am I doing anything wrong or is there any way to achieve that requirement? Many thanks in advance.

Image Attachments
test_pick_script.pngtest_pick_screen.png
 

 
  [ # 7 ]

For reproducability, CS defines the random seed at start based on the users login. And updates the seed after each volley. But… if you created a set of stuff, you could use a time value to remove some number of elements from it (random) and then use pick and the set will be different each time.

 

 
  [ # 8 ]

Thanks for the quick advice. Time value seems to be the only convenient variant. But I need to figure our maybe a different approach since I need to keep the entire set…:)

Thanks again.

 

 
  [ # 9 ]

double the size of the set (redundant facts), so some losses wont matter

 

 
  [ # 10 ]

Many thanks and no problem, Bruce. I’ve managed to do it with the %second value as you advised. Though kind of ugly but I’ve got my set randomized at each start of the topic now.

 

 
  login or register to react