示例#1
0
        public IConstraints9ConstraintElement Create(
            IpIndexElement pIndexElement,
            Ia a,
            ITHR THR,
            ITPx x)
        {
            IConstraints9ConstraintElement constraintElement = null;

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

            return(constraintElement);
        }
示例#2
0
        public Constraints9ConstraintElement(
            IpIndexElement pIndexElement,
            Ia a,
            ITHR THR,
            ITPx x)
        {
            Expression LHS = Expression.Sum(
                a.Value
                .Select(
                    i => x.Value[pIndexElement, i]));

            int RHS = THR.GetElementAtAsint(
                pIndexElement);

            this.Value = LHS == RHS;
        }
示例#3
0
        public ITHR Create(
            ImmutableList <ITHRParameterElement> value)
        {
            ITHR parameter = null;

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

            return(parameter);
        }