public IConstraints4ConstraintElement Create(
            IaIndexElement aIndexElement,
            Is s,
            IBLOCKS BLOCKS,
            ISPz z)
        {
            IConstraints4ConstraintElement constraintElement = null;

            try
            {
                constraintElement = new Constraints4ConstraintElement(
                    aIndexElement,
                    s,
                    BLOCKS,
                    z);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(constraintElement);
        }
        public Constraints5ConstraintElement(
            IaIndexElement aIndexElement,
            IsIndexElement sIndexElement,
            Ip p,
            Idur dur,
            ILENGTH LENGTH,
            IP P,
            ISPx x,
            ISPz 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 =
                z.Value[sIndexElement, aIndexElement]
                *
                (double)LENGTH.Value.Value.Value;

            this.Value = LHS <= RHS;
        }
        public IConstraints5ConstraintElement Create(
            IaIndexElement aIndexElement,
            IsIndexElement sIndexElement,
            Ip p,
            Idur dur,
            ILENGTH LENGTH,
            IP P,
            ISPx x,
            ISPz z)
        {
            IConstraints5ConstraintElement constraintElement = null;

            try
            {
                constraintElement = new Constraints5ConstraintElement(
                    aIndexElement,
                    sIndexElement,
                    p,
                    dur,
                    LENGTH,
                    P,
                    x,
                    z);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(constraintElement);
        }
Exemplo n.º 4
0
        public Constraints4ConstraintElement(
            IaIndexElement aIndexElement,
            Is s,
            IBLOCKS BLOCKS,
            ISPz z)
        {
            Expression LHS = Expression.Sum(
                s.Value
                .Select(
                    i => z.Value[i, aIndexElement]));

            int RHS = BLOCKS.Value.Value.Value;

            this.Value = LHS <= RHS;
        }
Exemplo n.º 5
0
        public ISPz Create(
            ImmutableList <ISPzResultElement> value)
        {
            ISPz result = null;

            try
            {
                result = new SPz(
                    value);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(result);
        }
Exemplo n.º 6
0
        public ISPz Create(
            VariableCollection <IsIndexElement, IaIndexElement> value)
        {
            ISPz variable = null;

            try
            {
                variable = new SPz(
                    value);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(variable);
        }