KWR-Water / pysimdeum

SIMDEUM in python
European Union Public License 1.2
17 stars 7 forks source link

Probability overlapping #19

Closed Yukun-Xie closed 3 months ago

Yukun-Xie commented 2 years ago

Once an event happens, the probability distribution should be revised and renormalized again. Otherwise, for an end use with long time duration, events will overlap. For example, washing machine and shower. Possible solution: prob_joint = normalize(prob_user * prob_usage) j = len(users) freq = self.fctfrequency(numusers=len(users)) for in range(freq): duration, intensity = self.fct_duration_intensity() u = np.random.uniform() start = np.argmin(np.abs(np.cumsum(prob_joint) - u)) end = start + duration consumption[start:end, j, ind_enduse, pattern_num] = intensity

prob_joint[start - duration + 1:start + duration] = 0
prob_joint = normalize(prob_joint)
BramHillebrand commented 3 months ago

But end uses are allowed to overlap by design. Close issue as wont fix