parameters: (solver, binvars, weights, loadvars)
docstring: post the load constraint on bins.
  
    constraints forall j: loadvars[j] == sum_i (binvars[i] == j) * weights[i])
docstring_summary: post the load constraint on bins.
docstring_tokens: post the load constraint on bins .
function: def BinPacking(solver, binvars, weights, loadvars):
    """post the load constraint on bins.
  
    constraints forall j: loadvars[j] == sum_i (binvars[i] == j) * weights[i])
    """
    pack = solver.Pack(binvars, len(binvars))
    pack.AddWeightedSumEqualVarDimension(weights, loadvars)
    solver.Add(pack)
    solver.Add(solver.SumEquality(loadvars, sum(weights)))
function_tokens: def BinPacking ( solver , binvars , weights , loadvars ) : pack = solver . Pack ( binvars , len ( binvars ) ) pack . AddWeightedSumEqualVarDimension ( weights , loadvars ) solver . Add ( pack ) solver . Add ( solver . SumEquality ( loadvars , sum ( weights ) ) )