public ITotalTime Calculate(
     ITotalTimeFactory totalTimeFactory,
     Isark sark,
     ILength Length,
     ITPz z)
 {
     return(totalTimeFactory.Create(
                sark.Value
                .Select(w =>
                        z.GetElementAtAsint(
                            w.sIndexElement,
                            w.aIndexElement,
                            w.rIndexElement,
                            w.kIndexElement)
                        *
                        Length.GetElementAtAsdecimal(
                            w.kIndexElement))
                .Sum()));
 }
        public Constraints15ConstraintElement(
            IaIndexElement aIndexElement,
            IrIndexElement rIndexElement,
            Isk sk,
            ILength Length,
            IORday ORday,
            ITPz z)
        {
            Expression LHS = Expression.Sum(
                sk.Value
                .Select(
                    i =>
                    z.Value[i.sIndexElement, aIndexElement, rIndexElement, i.kIndexElement]
                    *
                    (double)Length.GetElementAtAsdecimal(
                        i.kIndexElement)));

            double RHS = (double)ORday.GetElementAtAsdecimal(
                aIndexElement,
                rIndexElement);

            this.Value = LHS <= RHS;
        }
        public Constraints16ConstraintElement(
            IaIndexElement aIndexElement,
            IsIndexElement sIndexElement,
            Ip p,
            Irk rk,
            Idur dur,
            ILength Length,
            IP P,
            ITPx x,
            ITPz z)
        {
            Expression LHS = Expression.Sum(
                p.Value
                .Where(
                    i =>
                    P.IsThereElementAt(
                        sIndexElement,
                        i))
                .Select(
                    i =>
                    (double)dur.GetElementAtAsdecimal(
                        i)
                    *
                    x.Value[i, aIndexElement]));

            Expression RHS = Expression.Sum(
                rk.Value
                .Select(
                    i =>
                    z.Value[sIndexElement, aIndexElement, i.rIndexElement, i.kIndexElement]
                    *
                    (double)Length.GetElementAtAsdecimal(
                        i.kIndexElement)));

            this.Value = LHS <= RHS;
        }