From 7554db24d8991016bbe476e2ce4922fecd6bfd3c Mon Sep 17 00:00:00 2001 From: Michael Wetter Date: Wed, 4 Oct 2023 11:47:32 -0700 Subject: [PATCH] Added missing seed, added icon (#3552) For #3549 --- .../BaseClasses/binaryVariableGeneration.mo | 8 ++++++- .../exponentialVariableGeneration.mo | 8 ++++++- Buildings/Occupants/BaseClasses/linear1D.mo | 2 ++ Buildings/Occupants/BaseClasses/logit1D.mo | 2 ++ .../Occupants/BaseClasses/logit1DQuadratic.mo | 2 ++ Buildings/Occupants/BaseClasses/logit2D.mo | 2 ++ .../Occupants/BaseClasses/weibull1DOFF.mo | 8 ++++--- .../Occupants/BaseClasses/weibull1DON.mo | 8 ++++--- .../BaseClasses/weibullVariableGeneration.mo | 23 ++++++++++++------- Buildings/package.mo | 19 ++++++++------- 10 files changed, 58 insertions(+), 24 deletions(-) diff --git a/Buildings/Occupants/BaseClasses/binaryVariableGeneration.mo b/Buildings/Occupants/BaseClasses/binaryVariableGeneration.mo index e5b614fdacd..0e2f8fbc581 100644 --- a/Buildings/Occupants/BaseClasses/binaryVariableGeneration.mo +++ b/Buildings/Occupants/BaseClasses/binaryVariableGeneration.mo @@ -1,10 +1,11 @@ within Buildings.Occupants.BaseClasses; function binaryVariableGeneration "Binary variables random generator" + extends Modelica.Icons.Function; input Real p(min=0, max=1) "Probaility of 1"; input Integer globalSeed "Seed for the random number generator"; output Boolean y "Random number"; protected - Integer localSeed "Local seed"; + Integer localSeed = 0 "Local seed"; Integer state[Modelica.Math.Random.Generators.Xorshift1024star.nState]; Real r(min=0, max=1) "Generated random number"; algorithm @@ -24,6 +25,11 @@ Higher p indicates a higher chance of generating true. ", revisions="