generate a randomSwitch programmatically

I have a desire to read a config file that includes things like this:

`
behaviors {
“/path/to/behavior” =
“/another/behavior” =
“/yet/another/behavior” =
}

`

What I need to do is step through all the keys, and make a total for all the counts, and turn each key into an element in a .randomSwitch()

In looking at the source code, randomSwitch has a private version that takes a List[(Double,ChainBuilder)]. But it’s private. So I can’t build my list programmatically from a config file and send it to randomSwitch, can I?

Would you consider exposing that version of randomSwitch? And maybe build a new 2.2 snapshot with that change? Please? :slight_smile:

If you can produce a List, you can produce an Array :wink:

My bad, I thought it was private so I couldn’t call it. Good to know! :slight_smile: