I have an arraylist (orderlist) of class ProductionOrder
with five fields (String ID
, int Quantity
, int Frequency_max
, int Frequency_average
, int Frequency_min
), which are filled by an excel file so each element of the collection is an excel row.
Each row of the excel represents the ID of the order and has quantity and frequency.
for example:
ID Quantity Frequency_max Frequency_average Frequency_min
123FD99 2 12 5 2
14ZY201 4 59 18 1
...
I need to duplicate the number of elements in the collection based on the quantity field of the collection itself so the result should look like this:
ID Frequency_max Frequency_average Frequency_min
14ZY201 59 18 1
14ZY201 59 18 1
14ZY201 59 18 1
14ZY201 59 18 1
123FD99 12 5 2
123FD99 12 5 2
How may I do it? Is it also possible to make this operation before filling the elements in the collection (ps. I'm using Apache POI for the excel)?
After that, I need to assign to each of the duplicated ID a random value based on a triangular distribution, with max, average and minimum set in the frequency columns. How may I do it?
Thanks