![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
![]() |
#12 |
Admiral
![]() |
![]()
My algorithm in detail (Initial inspiration: Stiebler & Hitman):
There are 2 counters: one for STORM (Windspeed > 14) and one for FOG, which are initially both set to 0. Everytime a condition (either storm or fog or both) is true, the according counter is incremented in order to count the time periods for storm and fog independently. If one condition is false (wind < 14 or no fog), the according counter is set back to 0, because the bad weather interval has obviously ended for that individual weather component. But if one of these counters reaches a certain, randomly generated, maximum value (between 2 and maybe 10), a tendency to a better weather is forced by manipulating some internal random values. This forcing a tendency to good weather will end, if both counters are below their individual maximum values, that means, the bad weather period has ended. This algorithm guarrantees, that storm and fog periods independently from each other cannot be longer than a certain maximum time. This is, because I had some situations with longer fog-periods but windspeed below 10m/s. Last edited by h.sie; 12-01-10 at 03:03 AM. |
![]() |
![]() |
|
|