public IConstraints3ConstraintElement Create( IdIndexElement dIndexElement, IwIndexElement wIndexElement, Ipa pa, IA A, IP P, ISPx x, ISPy y) { IConstraints3ConstraintElement constraintElement = null; try { constraintElement = new Constraints3ConstraintElement( dIndexElement, wIndexElement, pa, A, P, x, y); } catch (Exception exception) { this.Log.Error( exception.Message, exception); } return(constraintElement); }
public Constraints3ConstraintElement( IdIndexElement dIndexElement, IwIndexElement wIndexElement, Ipa pa, IA A, IP P, ISPx x, ISPy y) { Expression LHS = Expression.Sum( pa.Value .Where( i => P.IsThereElementAt( wIndexElement, i.pIndexElement) && A.IsThereElementAt( i.pIndexElement, dIndexElement, i.aIndexElement)) .Select( i => x.Value[i.pIndexElement, i.aIndexElement])); Expression RHS = y.Value[wIndexElement]; this.Value = LHS <= RHS; }
public Constraint2( Iw w, IBEDS BEDS, ISPy y) { Expression LHS = Expression.Sum( w.Value .Select( i => y.Value[i])); int RHS = BEDS.Value.Value.Value; this.Value = LHS <= RHS; }
public ISPy Create( VariableCollection <IwIndexElement> value) { ISPy variable = null; try { variable = new SPy( value); } catch (Exception exception) { this.Log.Error( exception.Message, exception); } return(variable); }
public ISPy Create( ImmutableList <ISPyResultElement> value) { ISPy result = null; try { result = new SPy( value); } catch (Exception exception) { this.Log.Error( exception.Message, exception); } return(result); }
public IConstraint2 Create( Iw w, IBEDS BEDS, ISPy y) { IConstraint2 constraint = null; try { constraint = new Constraint2( w, BEDS, y); } catch (Exception exception) { this.Log.Error( exception.Message, exception); } return(constraint); }