Link to home
Start Free TrialLog in
Avatar of AndyC1000
AndyC1000

asked on

Create average result of monte carlo

Dear all,

I have created a monte carlo simulation, the output is 1000 separate result files.  I have been asked to create an average result, the total of each field across the 1000 files / number of files ( 1000).

I thought about creating a tree map storing the long (Date time), and the double value.  

Each field in the file will have a separate hash map
<Long, Double> averageAppliances = new TreeMap<>();


For the second file out of 1000 get the value for the long, add it the current value and so on until each file and field has been processed.

I'm not sure if this will work. Whether I can getValue(), add it to the existing value and put it back (replace) in the map.  I'm storing this data whilst writing the files.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of mccarl
mccarl
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial