示例#1
0
        internal void SetParScaleFactor()
        {
            // it is important to set infoStore.parScaleFactor already here, to be ready for the actual scaling, which is done in ParBase.GetPeriods:
            // this function is called in FunBase.TakePar, immediately after FunBase.ClassifyParameters
            // ClassifyParameters generates e.g. formulas (ParFormula), which call ParBase.GetPeriods in the constructor
            // that means each function after the very Scale-function will be affected by the scaling

            ParNumber parFactorPar = GetUniquePar <ParNumber>(DefPar.Scale.FactorParameter);

            if (parFactorPar == null)
            {
                return;
            }

            // as all the preparing is not yet done, we cannot rely on the "normal automatic" handling, but need to pre-handle here, e.g. the run-condition
            coParRunCond = GetUniquePar <ParCond>(DefPar.Common.Run_Cond);
            if (coParRunCond != null)
            {
                coParRunCond.CheckAndPrepare(this);
                if (!IsRunCondMet())
                {
                    return;
                }
            }

            parFactorPar.CheckAndPrepare(this);
            double factorPar = parFactorPar.GetValue();

            infoStore.parScaleFactor = factorPar;
        }