예제 #1
0
        /// <summary>Gets the value.</summary>
        /// <value>The value.</value>
        public double Value(int arrayIndex = -1)
        {
            if (ChildFunctions == null)
            {
                ChildFunctions = FindAllChildren <IFunction>().ToList();
            }

            foreach (IFunction F in ChildFunctions)
            {
                PhaseLookupValue P = F as PhaseLookupValue;
                if (P.InPhase)
                {
                    return(P.Value(arrayIndex));
                }
            }
            return(0);  // Default value is zero
        }
예제 #2
0
        /// <summary>Gets the value.</summary>
        /// <value>The value.</value>
        public double Value(int arrayIndex = -1)
        {
            if (ChildFunctions == null)
            {
                ChildFunctions = Apsim.Children(this, typeof(IFunction));
            }

            foreach (IFunction F in ChildFunctions)
            {
                PhaseLookupValue P = F as PhaseLookupValue;
                if (P.InPhase)
                {
                    return(P.Value(arrayIndex));
                }
            }
            return(0);  // Default value is zero
        }