-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kendrick Simulator can not work in large population scale free network #76
Comments
I have fixed this issue, the main problem is - I guess - the time complexity of saveCompartmentsValueAtTime: O(N*N) - order N square. model population compartment keysAndValuesDo will loop N times (N is number of compartment). In case 10000 individuals and three status #(S, I, R), N = 10000 x 3 = 30000. Therefore, I suggest the code above is replaced by: Assuming that (model population compartments) at: (e compartment) requires a constant time, the new version will take O(N) because timeSeriesOutputs do loops N times. Last but not least, I increase the step of simulator to 0.5 (instead of 0.1), and it takes about 3 hours to finish. Finally, I got this result: |
Integrate code from : master...thanhbka85dn:master |
Implementing Bansal's idea for Kendrick simulator works well in scale-free network with SMALL population.
I run the test case with 100 individuals and it prints a nice graph:
But as trying larger population, such as 1000 or 10000 individuals, the simulator leaks memory and not responding at all.
I will take care of this case.
The text was updated successfully, but these errors were encountered: