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);
        }
示例#2
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;
        }
示例#3
0
        public IBLOCKS Create(
            PositiveInt value)
        {
            IBLOCKS parameter = null;

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

            return(parameter);
        }