Distribution in random value

Hi,

Is there a way that i can assign distribution to below in-line randomize bcnt value. This randomization is not a part of class.

randomize(bcnt) with { bcnt inside { 1, 8, 16, 32, 64, 128, 256 }; };

Thanks,
Nainesh

In reply to nainesh:

Sure. You can use the dist constraint, where the number after := is the weight of the value. In the example below each value has the same weight.


std::randomize(bcnt) with {bcnt dist {1 := 1, 8 := 1, 16 := 1, 32 := 1, 64 := 1, 128 := 1, 256 := 1};) 

Note that using dist has the same effect as inside, in that values with no weight specified are given a weight of 0.

In reply to sbellock:

Thanks, its working