This is an example of modelling complex stochastic system where output is an input dependent random variable with multimodal distribution.

Let us consider the system with three inputs. The first input parameter is a probability $P$ which takes values from $0.1$ to $0.9$.
Next two parameters are numbers of quantities of two sets of dice $N1$ and $N2$ which take values from $3$ to $12$.

Our records will look like following
0.4, 5, 9, 20
0.8, 3, 7, 28
First record means that with probability $0.4$ the first set of dice is selected and with the opposite probability the second set is selected. The dice are rolled, all numbers are added and this is how we obtain the ouput $20$. The goal of modelling is to train model to return distributions for given inputs, not used in training. The accuracy can be assessed by Monte Carlo sampling. The distributions may look bimodal or, in some cases, unimodal, here is one example:

The accuracy metrics are explained in the previous article. Here is the table with result of using divisive data resorting algorithm

Test results for 8 executions of DDR code
Expectations 0.980.970.990.980.980.990.980.98
Variances 0.960.960.970.960.970.930.980.96
KL divergences0.0300.0540.0360.0470.0320.0530.0300.049

And here is the link for code download.