Topic
  • 2 replies
  • Latest Post - ‏2018-05-18T14:34:28Z by Janisch
Janisch
Janisch
9 Posts

Pinned topic Implement in Cplex

‏2018-05-18T12:44:23Z |

Hello everyone :)

Me again...

I want to implement the following (attachment) model.

I have a problem with the constraint called: Startbedingung. How can i fix it?

I hope someone could help me :)

Updated on 2018-05-18T13:09:13Z at 2018-05-18T13:09:13Z by Janisch
  • DanielJunglas
    DanielJunglas
    250 Posts
    ACCEPTED ANSWER

    Re: Implement in Cplex

    ‏2018-05-18T13:28:38Z  

    Running your model here I get this error for "Startbedingung": Index out of bound for array "Ende": 0

    And indeed, your model says

    forall(i in Stationen){
      Ende[0][i]["1"]==0;
      Ende[0][i]["2"]==0;
    }

    And indeed, the first index of Ende should come from "Fertigungstakte" and this is defined as

    range    Fertigungstakte  = 1..Fertigungstakt;

    No 0 there. The first valid index is 1. I am not sure what you are trying to do. Is this Fertigungstakt number 0 some special and artificial thing? If that is the case you could define

    range Fertigungstakte0 = 0..Fertigungstakt;
    dvar int Ende[Fertigungstakte0][Stationen][Arbeitsplatz];

    and keep the rest of the model as is.

  • DanielJunglas
    DanielJunglas
    250 Posts

    Re: Implement in Cplex

    ‏2018-05-18T13:28:38Z  

    Running your model here I get this error for "Startbedingung": Index out of bound for array "Ende": 0

    And indeed, your model says

    forall(i in Stationen){
      Ende[0][i]["1"]==0;
      Ende[0][i]["2"]==0;
    }

    And indeed, the first index of Ende should come from "Fertigungstakte" and this is defined as

    range    Fertigungstakte  = 1..Fertigungstakt;

    No 0 there. The first valid index is 1. I am not sure what you are trying to do. Is this Fertigungstakt number 0 some special and artificial thing? If that is the case you could define

    range Fertigungstakte0 = 0..Fertigungstakt;
    dvar int Ende[Fertigungstakte0][Stationen][Arbeitsplatz];

    and keep the rest of the model as is.

  • Janisch
    Janisch
    9 Posts

    Re: Implement in Cplex

    ‏2018-05-18T14:34:28Z  

    Running your model here I get this error for "Startbedingung": Index out of bound for array "Ende": 0

    And indeed, your model says

    forall(i in Stationen){
      Ende[0][i]["1"]==0;
      Ende[0][i]["2"]==0;
    }

    And indeed, the first index of Ende should come from "Fertigungstakte" and this is defined as

    range    Fertigungstakte  = 1..Fertigungstakt;

    No 0 there. The first valid index is 1. I am not sure what you are trying to do. Is this Fertigungstakt number 0 some special and artificial thing? If that is the case you could define

    range Fertigungstakte0 = 0..Fertigungstakt;
    dvar int Ende[Fertigungstakte0][Stationen][Arbeitsplatz];

    and keep the rest of the model as is.

    Thank you!