Esempio n. 1
0
        public IConstraints6UConstraintElement Create(
            IpIndexElement pIndexElement,
            Ia a,
            IUB UB,
            ISPx x)
        {
            IConstraints6UConstraintElement constraintElement = null;

            try
            {
                constraintElement = new Constraints6UConstraintElement(
                    pIndexElement,
                    a,
                    UB,
                    x);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(constraintElement);
        }
Esempio n. 2
0
        public Constraints6UConstraintElement(
            IpIndexElement pIndexElement,
            Ia a,
            IUB UB,
            ISPx x)
        {
            Expression LHS = Expression.Sum(
                a.Value
                .Select(
                    i => x.Value[pIndexElement, i]));

            int RHS = UB.GetElementAtAsint(
                pIndexElement);

            this.Value = LHS <= RHS;
        }
Esempio n. 3
0
        public IUB Create(
            ImmutableList <IUBParameterElement> value)
        {
            IUB parameter = null;

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

            return(parameter);
        }