float sum=0; for(int i = 0; i < ch("folder2"); i++) { sum += ch("probability" + itoa(i + 1)); } float rand = rand((@id + ch("seed")+0.21) + (ch("seed"))); rand = fit01(rand, 0, sum); sum = 0; for(int i = 0; i < ch("folder2"); i++) { sum += ch("probability" + itoa(i + 1)); if(rand<sum) { i@atr = chi("atr" + itoa(i + 1)); break; } }
"probability" parms are actually proportion. In this photo, each of them is set to 1, which means both are equally and randomly picked up.
タグ
コメントをかく