davidyannick Posted April 3, 2020 Share Posted April 3, 2020 I try to use variant and each time at point 0 as always the same variant, even when I change the seed ? any idea ? thanks copy_variant.hiplc Quote Link to comment Share on other sites More sharing options...
6ril Posted April 3, 2020 Share Posted April 3, 2020 (edited) Salut David, it's weird indeed. I bet it's from the random function at ZERO. Here is one way to go around the problem: just replace the multiple by your seed (*) by an addition (+) then it should avoid the zero, and solve your problem i@variant=int(fit01(rand(@ptnum+chf("seed")),0,3)); instead of : i@variant=int(fit01(rand(@ptnum*chf("seed")),0,3)); Edited April 3, 2020 by 6ril 1 Quote Link to comment Share on other sites More sharing options...
davidyannick Posted April 3, 2020 Author Share Posted April 3, 2020 9 minutes ago, 6ril said: Salut David, it's weird indeed. I bet it's from the random function at ZERO. Here is one way to go around the problem: just replace the multiple by your seed (*) by an addition (+) then it should avoid the zero, and solve your problem i@variant=int(fit01(rand(@ptnum+chf("seed")),0,3)); instead of : i@variant=int(fit01(rand(@ptnum*chf("seed")),0,3)); you're right thanks for your help Quote Link to comment Share on other sites More sharing options...
anim Posted April 3, 2020 Share Posted April 3, 2020 if you want to be safer and also to avoid increasing seed by increments of 1 just offseting the same random number to the next point you can use 2 dimensional rand(float, float) i@variant=int(fit01(rand(@ptnum,chf("seed")),0,3)); 2 Quote Link to comment Share on other sites More sharing options...
davidyannick Posted April 3, 2020 Author Share Posted April 3, 2020 1 hour ago, anim said: if you want to be safer and also to avoid increasing seed by increments of 1 just offseting the same random number to the next point you can use 2 dimensional rand(float, float) i@variant=int(fit01(rand(@ptnum,chf("seed")),0,3)); thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.