Exemple #1
0
        // Constructor: v is a parameter and y is a variable (0x1)
        public Constraints1ConstraintElement(
            ImIndexElement mIndexElement,
            IrIndexElement rIndexElement,
            Im m,
            Is s,
            Interfaces.Parameters.MachineOperatingRoomAssignments.Iv v,
            Iζ ζ,
            Interfaces.Variables.Iy y)
        {
            Expression LHS = Expression.Sum(
                s.Value
                .Select(
                    x => y.Value[x, rIndexElement]
                    *
                    ζ.GetElementAtAsint(
                        x,
                        mIndexElement)));

            int RHS = m.GetM()
                      *
                      v.GetElementAtAsint(
                mIndexElement,
                rIndexElement);

            this.Value = LHS <= RHS;
        }
Exemple #2
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;
        }