Topic
4 replies Latest Post - ‏2013-04-28T12:48:56Z by AlexFleischer
6BWF_Thomas_PIERRARD
2 Posts
ACCEPTED ANSWER

Pinned topic Tutorial ODM 3.7 : Adding Requirements

‏2013-04-18T08:26:39Z |

Hello,

 

I just installed ODME 3.7 working with Eclipse, I'm following the step by step tutorial and I'm stuck on "task8 : Create requirements on goals views and run the completed application."

On steps :

 

  1. Click the Requirements tab. -> Done, no elements under it !

  2. Right-click the Requirements element and choose New Group. -> I can do it but on the "new group" folder that I'm creating, I cannot choose the "add new requirements", the button is in grey and unclickable :(

Thans for your help !

Tom

  • V4B5_HOCK_ANN_CHUA
    V4B5_HOCK_ANN_CHUA
    1 Post
    ACCEPTED ANSWER

    Re: Tutorial ODM 3.7 : Adding Requirements

    ‏2013-04-23T21:56:00Z  in response to 6BWF_Thomas_PIERRARD

    Hi Tom, can you check if the opl model has any error message? Or check for any issue reported in the issue panel.

  • SebastianFink
    SebastianFink
    1 Post
    ACCEPTED ANSWER

    Re: Tutorial ODM 3.7 : Adding Requirements

    ‏2013-04-24T07:59:18Z  in response to 6BWF_Thomas_PIERRARD

    Hi Tom,

    you can only convert labelled constraints from the OPL model into requirements - could you also make sure that at least one constraint is labelled, i.e.

    forall(r in Resources, t in Periods)
                  not_exceed_resource: sum(p in Products) consumption[r][p] * inside[p][t] <= capacity[r];
    

    where "not_exceed_resource" is the label of the constraint.

    Updated on 2013-04-24T08:01:21Z at 2013-04-24T08:01:21Z by SebastianFink
  • 6BWF_Thomas_PIERRARD
    2 Posts
    ACCEPTED ANSWER

    Re: Tutorial ODM 3.7 : Adding Requirements

    ‏2013-04-24T08:28:51Z  in response to 6BWF_Thomas_PIERRARD

     

    Hello !

    No errors and the consttraint was uncommented ! :(

    What I did is start a new project from scratch. I modelised the famous knapsack problem : 

    /*********************************************

    * OPL 12.5 Model

    * Author:

     * Creation Date: 23 avr. 2013 at 15:02:17

    *********************************************/

    include "knapsack_odm.mod";

     

    // ----------- constants -------------------

    int n = 8;

    range R = 1..n;

     

    // ------------ decision variables -----------------

    dvar int xi[R] in R;

     

    // ------------ objective -----------------

    dexpr float cost = sum(x in objIn)

          (x.coeff*xi[x.id]);

     

    maximize cost;

    // ------------ constraints -----------------

    subject to {

       capacity_constraint : sum(x in objIn)(x.weight*xi[x.id]) <= n;

    };

     

    // ------------ postprocessing -----------------

    execute UPDATE_RESULTS {

        for (var x in objIn) {

             objOut.add(x.id,x[x.id]);

          }

    }

     

    execute DISPLAY {

      writeln("optim=",objOut);

    }

    You can see in the file attached that I have no errors nor warning in Eclipse...

    And you can see that the menu is still greyed out :(

    Thanks for your replies though.

     

    Tom

    Attachments

  • AlexFleischer
    AlexFleischer
    16 Posts
    ACCEPTED ANSWER

    Re: Tutorial ODM 3.7 : Adding Requirements

    ‏2013-04-28T12:48:56Z  in response to 6BWF_Thomas_PIERRARD

    Hi

     

    but other conditions are needed to map requirements:

    the labeled constraint should be a forall that iterates on a tuple set like the one in the getting started manual

    regards