Itoo Software Forum

RailClone => RailClone Lite => Topic started by: SeanRedmond on September 27, 2022, 12:32:34 AM

Title: Expression for Weighted Randomization
Post by: SeanRedmond on September 27, 2022, 12:32:34 AM
I'm trying to write an expression or node group that will let me select from input segments randomly, but with weights for added control.. I could use a selector and double up inputs but that doesn't allow as much control + gets pretty clunky. Does anyone have any solutions? Here is the solution I'm trying to translate to Railclone (and my poor attempt is there too).

https://imgur.com/sQDutex
https://imgur.com/S7ygL1x

Thanks!!
Title: Re: Expression for Weighted Randomization
Post by: Paul Roberts on September 27, 2022, 09:23:12 AM
HI,

If it's segments that you're trying to randomise, could you use the Random node? It already has built-in probability settings (called Presence)

(https://i.imgur.com/aa8HChA.png)

Cheers,
Paul
Title: Re: Expression for Weighted Randomization
Post by: SeanRedmond on September 27, 2022, 03:13:11 PM
Well this is embarrassing  ;D I had no idea that existed.

Thank you so much!