Esempio n. 1
0
        public Constraints2ConstraintElement(
            IsIndexElement sIndexElement,
            Ir r,
            IB B,
            Ib b)
        {
            Expression LHS = Expression.Sum(
                r.Value
                .Select(
                    x => b.Value[sIndexElement, x]));

            int RHS = B.GetElementAtAsint(
                sIndexElement);

            this.Value = LHS == RHS;
        }
Esempio n. 2
0
        public Constraints5MConstraintElement(
            IrIndexElement rIndexElement,
            IsIndexElement sIndexElement,
            IB B,
            Ib b,
            Iy y)
        {
            Expression LHS = b.Value[sIndexElement, rIndexElement];

            Expression RHS = B.GetElementAtAsint(
                sIndexElement)
                             *
                             y.Value[sIndexElement, rIndexElement];

            this.Value = LHS <= RHS;
        }
        // Constructor: y is a parameter (xx0)
        public Constraints5MConstraintElement(
            IrIndexElement rIndexElement,
            IsIndexElement sIndexElement,
            IB B,
            Interfaces.Parameters.SurgeonOperatingRoomAssignments.Iy y,
            Interfaces.Variables.Ib b)
        {
            Expression LHS = b.Value[sIndexElement, rIndexElement];

            int RHS = B.GetElementAtAsint(
                sIndexElement)
                      *
                      y.GetElementAtAsint(
                sIndexElement,
                rIndexElement);

            this.Value = LHS <= RHS;
        }