// w is a parameter and y is a variable
        public IConstraints5UConstraintElement Create(
            IjIndexElement jIndexElement,
            IrIndexElement rIndexElement,
            IsIndexElement sIndexElement,
            Interfaces.Parameters.SurgicalSpecialtyNumberAssignedTimeBlocks.IB BBar,
            Interfaces.Parameters.SurgeonNumberAssignedTimeBlocks.IB Bs,
            Interfaces.Parameters.SurgicalSpecialtyOperatingRoomAssignments.Iw w,
            Interfaces.Variables.Iy y)
        {
            IConstraints5UConstraintElement constraintElement = null;

            try
            {
                constraintElement = new Constraints5UConstraintElement(
                    jIndexElement,
                    rIndexElement,
                    sIndexElement,
                    BBar,
                    Bs,
                    w,
                    y);
            }
            catch (Exception exception)
            {
                this.Log.Error(
                    exception.Message,
                    exception);
            }

            return(constraintElement);
        }
コード例 #2
0
 // Constructor: w and y are both parameters (x00)
 public Constraints5UConstraintElement(
     IjIndexElement jIndexElement,
     IrIndexElement rIndexElement,
     IsIndexElement sIndexElement,
     Interfaces.Parameters.SurgicalSpecialtyNumberAssignedTimeBlocks.IB BBar,
     Interfaces.Parameters.SurgeonNumberAssignedTimeBlocks.IB Bs,
     Interfaces.Parameters.SurgicalSpecialtyOperatingRoomAssignments.Iw w,
     Interfaces.Parameters.SurgeonOperatingRoomAssignments.Iy y)
 {
     // Not needed
 }
コード例 #3
0
        public Constraints5UConstraintElement(
            IjIndexElement jIndexElement,
            IrIndexElement rIndexElement,
            IsIndexElement sIndexElement,
            Interfaces.Parameters.SurgicalSpecialtyNumberAssignedTimeBlocks.IB BBar,
            Interfaces.Parameters.SurgeonNumberAssignedTimeBlocks.IB Bs,
            Iw w,
            Iy y)
        {
            Expression LHS = Bs.GetElementAtAsint(
                sIndexElement)
                             *
                             y.Value[sIndexElement, rIndexElement];

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

            this.Value = LHS <= RHS;
        }
コード例 #4
0
        // 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;
        }