Topic
  • 2 replies
  • Latest Post - ‏2018-05-17T17:52:32Z by Janisch
Janisch
Janisch
9 Posts

Pinned topic dvar as condition

‏2018-05-17T16:57:03Z |

Hello everyone :)

I have a little problem:

I want to implement the following constraints (upload).

My try:

dvar boolean x[V][T];

constraints:

forall(t in T){sum(v in V)x[v][t]==1};

forall(v in V){sum(t in T)x[v][t]==d[v]};

 

But it didn´t work. ERROR:

aggregation operator forall for {boolean} not available

I hope someone could help me :)

Updated on 2018-05-17T16:58:51Z at 2018-05-17T16:58:51Z by Janisch
  • DanielJunglas
    DanielJunglas
    250 Posts
    ACCEPTED ANSWER

    Re: dvar as condition

    ‏2018-05-17T17:13:18Z  

    Your syntax is wrong. The parser gets confused and thus produces this weird error message. Try this (note the position of the semicolons):

      forall(t in T){sum(v in V)x[v][t]==1;}
      forall(v in V){sum(t in T)x[v][t]==d[v];}

     

  • DanielJunglas
    DanielJunglas
    250 Posts

    Re: dvar as condition

    ‏2018-05-17T17:13:18Z  

    Your syntax is wrong. The parser gets confused and thus produces this weird error message. Try this (note the position of the semicolons):

      forall(t in T){sum(v in V)x[v][t]==1;}
      forall(v in V){sum(t in T)x[v][t]==d[v];}

     

  • Janisch
    Janisch
    9 Posts

    Re: dvar as condition

    ‏2018-05-17T17:52:32Z  

    Your syntax is wrong. The parser gets confused and thus produces this weird error message. Try this (note the position of the semicolons):

      forall(t in T){sum(v in V)x[v][t]==1;}
      forall(v in V){sum(t in T)x[v][t]==d[v];}

     

    Oh...

    Thank you! I didn´t see it :)

    Now it works!