Topic
  • 7 replies
  • Latest Post - ‏2013-09-30T10:49:55Z by pickup
pickup
pickup
19 Posts

Pinned topic syntax errors 2

‏2013-09-26T11:36:37Z |

Hi M. ALEX,

for this constraint,

c4: forall ( v in V)  ( sum of  i in SEGP (0) ) X 0iv =1 ; to say all successors of node  0 ( 0 is the index of dépot) 

 

c5: forall ( v in V)  ( sum of  i in SEGM (0) ) X i0v =1 ; to say all predecessors of node  0 ( 0 is

 

for c4 it works now thank you,  c4: forall (v in V) 
sum (i in SEGM:i.n==0)Xijv[<i.e>][item(ICF,0)][v]==1;

but in c5 : i have error 

 

c5: forall (v in V) 
sum (i in SEGM:i.n==0)Xijv[<i.e>][item(ICF,0)][v]==1;

best regards 

 

 

  • AlexFleischer
    AlexFleischer
    1248 Posts
    ACCEPTED ANSWER

    Re: syntax errors 2

    ‏2013-09-26T13:44:24Z  
    This reply was deleted by pickup 2013-10-01T16:45:40Z. Reason for deletion: it's ok

    Hi,

     

    for c7, you may try

     

    c7: forall (k in K, i in OK)
    sum (v in V,j in SEGP:j.n==i.i) Yijvk[<i.k>][<j.s>][v][k]-sum (v in V, j in SEGM:j.n==i.i)Yijvk[<j.e>][<i.k>][v][k]==1;
     

    for c8, you wrote

    sum (v in V,j in SEGP:j.n==i.i) but i is unknown. Do you mean forall( i in ? ) ?

     

    regards

  • AlexFleischer
    AlexFleischer
    1248 Posts
    ACCEPTED ANSWER

    Re: syntax errors 2

    ‏2013-09-26T14:28:03Z  
    • pickup
    • ‏2013-09-26T14:06:08Z

    Hi

    MR alex,  with this solution I think you gived me the solution for theconstraint 8 not the constraint 7 ??

    because in constraint 7, i want to say :

    forll( k in K) and forall ( i in ICF wich i dispute OK and i dispute DK) 

    sum (v in V,j in SEGP:j.n==i.i)Yijvk[i][<j.s>][v][k] - sum (v in V, j in SEGM:j.n==i.i)Yijvk[<j.e>][i][v][k]==0;

    Regards 

    Heni

     

    Hi,

     

    Let me give you a constraint that is ok as far as the syntax is concerned:

     

    c7 : forall (k in K, i in ICF : <i.i> not in OK && <i.i> not in DK )

     
    sum (v in V,j in SEGP:j.n==i.i) Yijvk[i][<j.s>][v][k] - sum (v in V, j in SEGM:j.n==i.i)Yijvk[<j.e>][i][v][k]==0;
     

    regards

  • AlexFleischer
    AlexFleischer
    1248 Posts
    ACCEPTED ANSWER

    Re: syntax errors 2

    ‏2013-09-27T12:25:51Z  
    This reply was deleted by pickup 2013-10-01T16:45:54Z. Reason for deletion: it's ok

    Hi,

     

    for c9 you'd better write

    c9: forall (i in I ,j in J, v in V)
    sum (k in K) Yijvk[i][j][v][k]*item(qK,k).quantite <= item(QV,v).capacite*Xijv[i][j][v];

    NB:

    In the documentation, you should make sure you do not mix arrays and sets.

    Regards

     

    Alex Fleischer

  • AlexFleischer
    AlexFleischer
    1248 Posts

    Re: syntax errors 2

    ‏2013-09-26T12:24:07Z  

    Hi,

    which error do you have ?

    Can you attach your model ?

    regards

  • AlexFleischer
    AlexFleischer
    1248 Posts

    Re: syntax errors 2

    ‏2013-09-26T13:44:24Z  
    This reply was deleted by pickup 2013-10-01T16:45:40Z. Reason for deletion: it's ok

    Hi,

     

    for c7, you may try

     

    c7: forall (k in K, i in OK)
    sum (v in V,j in SEGP:j.n==i.i) Yijvk[<i.k>][<j.s>][v][k]-sum (v in V, j in SEGM:j.n==i.i)Yijvk[<j.e>][<i.k>][v][k]==1;
     

    for c8, you wrote

    sum (v in V,j in SEGP:j.n==i.i) but i is unknown. Do you mean forall( i in ? ) ?

     

    regards

  • pickup
    pickup
    19 Posts

    Re: syntax errors 2

    ‏2013-09-26T14:06:08Z  

    Hi,

     

    for c7, you may try

     

    c7: forall (k in K, i in OK)
    sum (v in V,j in SEGP:j.n==i.i) Yijvk[<i.k>][<j.s>][v][k]-sum (v in V, j in SEGM:j.n==i.i)Yijvk[<j.e>][<i.k>][v][k]==1;
     

    for c8, you wrote

    sum (v in V,j in SEGP:j.n==i.i) but i is unknown. Do you mean forall( i in ? ) ?

     

    regards

    Hi

    MR alex,  with this solution I think you gived me the solution for theconstraint 8 not the constraint 7 ??

    because in constraint 7, i want to say :

    forll( k in K) and forall ( i in ICF wich i dispute OK and i dispute DK) 

    sum (v in V,j in SEGP:j.n==i.i)Yijvk[i][<j.s>][v][k] - sum (v in V, j in SEGM:j.n==i.i)Yijvk[<j.e>][i][v][k]==0;

    Regards 

    Heni

     

  • AlexFleischer
    AlexFleischer
    1248 Posts

    Re: syntax errors 2

    ‏2013-09-26T14:28:03Z  
    • pickup
    • ‏2013-09-26T14:06:08Z

    Hi

    MR alex,  with this solution I think you gived me the solution for theconstraint 8 not the constraint 7 ??

    because in constraint 7, i want to say :

    forll( k in K) and forall ( i in ICF wich i dispute OK and i dispute DK) 

    sum (v in V,j in SEGP:j.n==i.i)Yijvk[i][<j.s>][v][k] - sum (v in V, j in SEGM:j.n==i.i)Yijvk[<j.e>][i][v][k]==0;

    Regards 

    Heni

     

    Hi,

     

    Let me give you a constraint that is ok as far as the syntax is concerned:

     

    c7 : forall (k in K, i in ICF : <i.i> not in OK && <i.i> not in DK )

     
    sum (v in V,j in SEGP:j.n==i.i) Yijvk[i][<j.s>][v][k] - sum (v in V, j in SEGM:j.n==i.i)Yijvk[<j.e>][i][v][k]==0;
     

    regards

  • pickup
    pickup
    19 Posts

    Re: syntax errors 2

    ‏2013-09-26T15:19:44Z  

    Hi,

     

    Let me give you a constraint that is ok as far as the syntax is concerned:

     

    c7 : forall (k in K, i in ICF : <i.i> not in OK && <i.i> not in DK )

     
    sum (v in V,j in SEGP:j.n==i.i) Yijvk[i][<j.s>][v][k] - sum (v in V, j in SEGM:j.n==i.i)Yijvk[<j.e>][i][v][k]==0;
     

    regards

    hi,

    I thank you it works very well,

    another one :  in a complete graph G = (I, A) which "I" represent the set of all the node and " D " the set of arcs 

     

    I defined the set of node as a tuple :

    tuple Sindnoeud{

        int i;
    }

    and i want to say in cplex :

    c9: for all ( v in V, (i,j) in A ) // (i,j) is an arc in A

     

    sum (k in K) Yijvk[i][j][v][k]*qK[k] <= QV[v]*Xijv[i][j][v];

    syntax errors : unspected errors ( (i,j) not an arc)

    Best regards

    Heni

     
    Updated on 2013-09-27T09:27:13Z at 2013-09-27T09:27:13Z by pickup
  • AlexFleischer
    AlexFleischer
    1248 Posts

    Re: syntax errors 2

    ‏2013-09-27T09:34:13Z  
    • pickup
    • ‏2013-09-26T15:19:44Z

    hi,

    I thank you it works very well,

    another one :  in a complete graph G = (I, A) which "I" represent the set of all the node and " D " the set of arcs 

     

    I defined the set of node as a tuple :

    tuple Sindnoeud{

        int i;
    }

    and i want to say in cplex :

    c9: for all ( v in V, (i,j) in A ) // (i,j) is an arc in A

     

    sum (k in K) Yijvk[i][j][v][k]*qK[k] <= QV[v]*Xijv[i][j][v];

    syntax errors : unspected errors ( (i,j) not an arc)

    Best regards

    Heni

     

    Hi,

     

    can you attach the model?

     

    Regards

     

    PS: do not hesitate to spend some time with the User Manual.

  • AlexFleischer
    AlexFleischer
    1248 Posts

    Re: syntax errors 2

    ‏2013-09-27T12:25:51Z  
    This reply was deleted by pickup 2013-10-01T16:45:54Z. Reason for deletion: it's ok

    Hi,

     

    for c9 you'd better write

    c9: forall (i in I ,j in J, v in V)
    sum (k in K) Yijvk[i][j][v][k]*item(qK,k).quantite <= item(QV,v).capacite*Xijv[i][j][v];

    NB:

    In the documentation, you should make sure you do not mix arrays and sets.

    Regards

     

    Alex Fleischer