public void Run(Clock clock, IImpactTropicalStormsState state, IDimensions dimensions) { var t = clock.Current; var s = state; foreach (var r in dimensions.GetValues <Region>()) { double ypc = s.income[t, r] / s.population[t, r] * 1000.0; double ypc90 = s.gdp90[r] / s.pop90[r] * 1000.0; // This is hurrican damage s.hurrdam[t, r] = 0.001 * s.hurrbasedam[r] * s.income[t, r] * Math.Pow(ypc / ypc90, s.hurrdamel) * (Math.Pow(1.0 + s.hurrpar * s.regstmp[t, r], s.hurrnl) - 1.0); s.hurrdead[t, r] = 1000.0 * s.hurrbasedead[r] * s.population[t, r] * Math.Pow(ypc / ypc90, s.hurrdeadel) * (Math.Pow(1.0 + s.hurrpar * s.regstmp[t, r], s.hurrnl) - 1.0); } }
public void Run(Clock clock, IImpactTropicalStormsState state, IDimensions dimensions) { var t = clock.Current; var s = state; foreach (var r in dimensions.GetValues<Region>()) { double ypc = s.income[t, r] / s.population[t, r] * 1000.0; double ypc90 = s.gdp90[r] / s.pop90[r] * 1000.0; // This is hurrican damage s.hurrdam[t, r] = 0.001 * s.hurrbasedam[r] * s.income[t, r] * Math.Pow(ypc / ypc90, s.hurrdamel) * (Math.Pow(1.0 + s.hurrpar * s.regstmp[t, r], s.hurrnl) - 1.0); s.hurrdead[t, r] = 1000.0 * s.hurrbasedead[r] * s.population[t, r] * Math.Pow(ypc / ypc90, s.hurrdeadel) * (Math.Pow(1.0 + s.hurrpar * s.regstmp[t, r], s.hurrnl) - 1.0); } }