Пример #1
0
        // Constructor: v is a variable and y is a parameter (1x0)
        public Constraints1ConstraintElement(
            ImIndexElement mIndexElement,
            IrIndexElement rIndexElement,
            Im m,
            Is s,
            Interfaces.Parameters.SurgeonOperatingRoomAssignments.Iy y,
            Iζ ζ,
            Interfaces.Variables.Iv v)
        {
            int LHS = s.Value
                      .Select(
                x => y.GetElementAtAsint(
                    x,
                    rIndexElement)
                *
                ζ.GetElementAtAsint(
                    x,
                    mIndexElement))
                      .Sum();

            Expression RHS = m.GetM()
                             *
                             v.Value[mIndexElement, rIndexElement];

            this.Value = LHS <= RHS;
        }
        // Constructor: y is a parameter (xx0)
        public Constraints5LConstraintElement(
            IrIndexElement rIndexElement,
            IsIndexElement sIndexElement,
            Interfaces.Parameters.SurgeonOperatingRoomAssignments.Iy y,
            Ib b)
        {
            int LHS = y.GetElementAtAsint(
                sIndexElement,
                rIndexElement);

            Expression RHS = b.Value[sIndexElement, rIndexElement];

            this.Value = LHS <= RHS;
        }
Пример #3
0
        // Constructor: y is a parameter (xx0)
        public Constraints10ConstraintElement(
            IrIndexElement rIndexElement,
            IsIndexElement sIndexElement,
            ItIndexElement tIndexElement,
            Interfaces.Parameters.SurgeonOperatingRoomAssignments.Iy y,
            Ix x)
        {
            Expression LHS = x.Value[sIndexElement, rIndexElement, tIndexElement];

            int RHS = y.GetElementAtAsint(
                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;
        }
        // Constructor: w is a variable and y is a parameter (x10)
        public Constraints5UConstraintElement(
            IjIndexElement jIndexElement,
            IrIndexElement rIndexElement,
            IsIndexElement sIndexElement,
            Interfaces.Parameters.SurgicalSpecialtyNumberAssignedTimeBlocks.IB BBar,
            Interfaces.Parameters.SurgeonNumberAssignedTimeBlocks.IB Bs,
            Interfaces.Parameters.SurgeonOperatingRoomAssignments.Iy y,
            Interfaces.Variables.Iw w)
        {
            int LHS = Bs.GetElementAtAsint(
                sIndexElement)
                      *
                      y.GetElementAtAsint(
                sIndexElement,
                rIndexElement);

            Expression RHS = BBar.GetElementAtAsint(
                jIndexElement)
                             *
                             w.Value[jIndexElement, rIndexElement];

            this.Value = LHS <= RHS;
        }