Distribution constraint question

In reply to bmorris:

Of course as soon as I hit “submit” I had an idea. I simply added a extra “helper variable” into my txn class:

randc uint32_t rand_ip;
if(!txn.randomize() with { ip dist { A:=1, B:=1, '0:=1, '1:=1, rand_ip:=1 }; })

Please feel free to weigh in, though.

On a side note, the reason I’m adding an in-line distribution is because the VALUES I want to constrain to are in the configuration database (A and B, for examples). If I were to extend my transaction class, it would doing a database access every time I created a transaction. That’s a no-no on performance, or so I’m told. Hence, I add the in-line constraint in the sequence, where I pull the values from the database only once. The reason I mention this, is because I get the sense that I should be leaning towards factory use and class extension, rather than in-line constraints. Thoughts?