manel1989 0 Light Poster

hi every one !

i'm sorry to be so bothering but i really don't know how to solve my problem here:

Mathematically, the placement problem of testers into the right nodes) can be modeled by merging the two introduced knapsack variants: multidimensional and multiple knapsack problems. The obtained model is called Multiple Multidimensional Knapsack Problem (MMKP).. We assume that the
execution environment consists of m nodes and we have n test components that
may be assigned to them. We attempt to find an optimal solution of test com-
ponent placement not violating resource and connectivity constraints and also
maximizing their placement profit. We can formulate this problem using the MMKP variant
there is more details in the file below Click Here

The provided resources by the m nodes are given through three vectors: C
that contains the provided CPU, R that provides the available RAM and B that
contains the battery level of each node( see the C,R,B representations)
Click Here

In addition, the required resources for each test component are illustrated over
three vectors: Dcthat carries the required CPU, Drthat contains the required
RAM and Dbthat contains the required Battery by each tester.( see the Dc,Dr,Db representations)

Click Here
i have got an error that i dont know the sorce , i will post also my code file MMKP.cpp

#include <gecode/driver.hh>
#include <gecode/int.hh>
#include <gecode/search.hh>
#include <gecode/minimodel.hh>

using namespace Gecode;

class MMKP : public Script{

    static const int n=4 ;//number of testers
    static const int m=5;// number of nodes
    IntArgs R;
    IntArgs C;
    IntArgs B;
    IntArgs Dr;
    IntArgs Dc;
    IntArgs Db;
    IntArgs g;

    IntVarArray a;
    IntVarArray k;
    IntVar l;
public :
    enum {
    find_Optimal_Solution, find_realizable_solution
    MMKP (const Options& opt) : a(*this,n*m, 0,1){



        k=IntVarArray(*this,n*m ,0,100000); 
        Matrix <IntVarArray> results(k, n,m);

        //creation variables

        //IntVarArray a(*this,n*m,0,1); // Array of n*m boolean variables
        Matrix <IntVarArray> X (a,n,m);// Matrix "view" of the array a

        // objectiv variable
        IntVar gain (*this, 1,1000000);

        //creation of constraints 
            // ... over rows
        for ( int j=0; j<n;j++)

                linear(*this , X.row(j),IRT_EQ,1);


        //... over columns
            // first, get the columns, we will use an intermidiare matrix XDual

        IntVarArray b(*this, m*n,0,1);
        Matrix <IntVarArray> XDual (b, m, n);
        for (int i=0; i<m;i++)
            for ( int j =0; j<n ; j++)

        for (int j = 0; j < m; j++) {

            linear(*this, Dr,XDual.row(j),IRT_NQ, R[j]);

        for (int j = 0; j < m; j++) {
            linear (*this, Dc, XDual.row(j), IRT_NQ,C[j]);


        for (int j = 0; j < m; j++) {
            linear (*this, Db, XDual.row(j), IRT_NQ,B[j]);

        switch (opt.model()) {
        case find_Optimal_Solution:

        //Objective function

        for (int i = 0; i < n; i++)
            linear(*this, g,X.row(i), IRT_EQ, gain);

        for ( int i=0; i<n;i++){
            for ( int j =0; j<m;j++)


        case find_realizable_solution:
            for ( int i=0; i<n;i++){
            for ( int j =0; j<m;j++)

            // post branching
        branch(*this, a, INT_VAR_SIZE_MAX(), INT_VAL_MAX());
        // search support
     MMKP(bool share, MMKP& s) : Script(share, s){
      a.update(*this, share, s.a);

    virtual Space* copy(bool share) {
      return new MMKP(share,*this);

        // print solution
    void print(std::ostream& os) const  {
        for(int i = 0; i < n; i++) {
         for(int j = 0; j < n; j++)
           os << std::setw(4) << a[i * n + j];
         os << std::endl;

    // main function
int main(int argc, char* argv[]) {
  Options opt("MMKP");

  return 0;

the eroor is :

exeption Int::linear :size of arguments mismatch 

Thanks for evry help and very sorry to bother you again