Hi, I am solving following problem: Suppose I have some multiset: > multiset <- c("a","a","c","d","d") and rules, which operate with it (for simplicity not writen in R functions) > rule1: "a" -> c("a","b") > rule2: "a" -> c("a","c") > rule3: "c" -> c("c","c") ... > ruleX: ...
I want to apply rules to multiset in maximaly parallel manner, but randomly (ie. rule1 and rule2 both work with object "a", but i want them to apply in non-deterministic way, so every time I run this procedure, I can get different result) Basically what I am looking for is some construct, which would enable me to do this: while (initial.multiset IS NOT empty){ apply(random rule, if possible) return(new.multiset) } I tried to organize rules into list, but i don't know how to select randomly function from a list and apply it Any help would be appreciated Thanks Zbynek -- View this message in context: http://r.789695.n4.nabble.com/applying-random-functions-to-multisets-tp3405203p3405203.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.