public Constraints4ConstraintElement(
            IrIndexElement rIndexElement,
            ItIndexElement tIndexElement,
            Iψ ψ,
            Iγ γ)
        {
            Expression LHS = γ.Value[rIndexElement, tIndexElement];

            int RHS = 1 - ψ.GetElementAtAsint(
                tIndexElement);

            this.Value = LHS <= RHS;
        }
Exemplo n.º 2
0
        public Constraint2(
            Ir r,
            Is s,
            It t,
            Iψ ψ,
            IB B)
        {
            Expression LHS = Expression.Sum(
                s.Value
                .Select(x => B.Value[x]));

            int RHS = r.GetR()
                      *
                      t.Value
                      .Select(x => 1 - ψ.GetElementAtAsint(x))
                      .Sum();

            this.Value = LHS == RHS;
        }