Topic
4 replies Latest Post - ‏2009-06-05T15:47:34Z by SystemAdmin
SystemAdmin
SystemAdmin
151 Posts
ACCEPTED ANSWER

Pinned topic turn on/off contraint

‏2008-12-03T02:38:35Z |

[Boon said:]

Hi,

Says in my optimization problem I have 10 carriers. The model will assign these carriers to each lane. (Simple assignment problem.)

In ODM, I would like to have a function that a user can trigger on/off each carrier. For example, in one run the user wants to not consider carrier A and carrier B in the model. How should I do this?

Thanks a lot
Boon
Updated on 2009-06-05T15:47:34Z at 2009-06-05T15:47:34Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    151 Posts
    ACCEPTED ANSWER

    Re: turn on/off contraint

    ‏2008-12-03T21:55:01Z  in response to SystemAdmin

    [alain.chabrier said:]

    Hi,

    some thoughts on how I would do it.

    i would have some parameters in the OPL model like :

    int useConstraintA = ...;
    int useConstraintB = ...;

    and in the model

      I would condition the constraint to these :

    if (useConstraintA==1)
      forall(...)

    In ODM you can do a view grouping all theses parameters.

    Hope this helps,

    Alain
    • SystemAdmin
      SystemAdmin
      151 Posts
      ACCEPTED ANSWER

      Re: turn on/off contraint

      ‏2008-12-11T04:58:18Z  in response to SystemAdmin

      [Can_T_OM said:]

      Hi,

      I would do it without any OPL coding! The easiest way is to design a pre-processing phase (e.g. query if you are using access). Let us assume you have a list of 10 carriers. Let us design a table T with 2 fields : Carrier Name and Turn_On_Off_Flag (boolean values). The list of carriers that you will be using for the current run can be read from a query  that involves the table T such that the parameter Turn_On_Off_Flag is equal to 1.

      That's it!

      Good luck.

      Nourredine.
      • SystemAdmin
        SystemAdmin
        151 Posts
        ACCEPTED ANSWER

        Re: turn on/off contraint

        ‏2009-03-27T06:20:04Z  in response to SystemAdmin

        [Boon said:]

        Thanks for your answers.

        Can we use if condition in OPL? I thought we can use only mathematical constraints not logic type of thing.

        Here is the situation. The model is assignment problem. The model will choose the best assignment. Then I have another set of constraints (forall) that will force the assignment. I would like to be able to switch on/off this constraint in ODM. How can I do this?

        Thanks a lot!
        • SystemAdmin
          SystemAdmin
          151 Posts
          ACCEPTED ANSWER

          Re: turn on/off contraint

          ‏2009-06-05T15:47:34Z  in response to SystemAdmin

          [NicoSantiago said:]

                        I agree to alain.chabrier. This maybe serves as your guide. Good luck.


          _________________
          [url=http://www.dehumidifierexperts.com/]Basement Dehumidifier[/url]