How to dynamically change randcase branch weight?

Hi,

Is there some good ways to change randcase branch weight?

The scenario is like this:

I have a randcase to randomly pick up branch A,B,C as below.
randcase
10: //do A
2: //do B
5: //do C
endcase

Normally, it will pick up one branch based on the weight in left-hand side.
In some testcases, I only want to pick up one branch, let’s say “do A”. Is there some good ways to do it?

Thanks,
Tom

In reply to mlsxdx:

You can make the weights variables and change the variables as needed.