<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hello Richard,<br>
      <br>
      here some additional remarks to your questions:<br>
      <br>
      3) You have defined the regions as sets, and the ports as arrays.
      In such a setup you should define the routes over the regions. For
      all routes this is simple:<br>
      <br>
          routes := [producing_regions, consuming_regions];<br>
      <br>
      You can check the routes with:<br>
          <br>
          { r in routes: echo r; }<br>
      <br>
      If you prefer to define the routes over the ports, then you should
      define the ports also as sets. You can make sets from your arrays
      by:<br>
      <br>
          export_ports_set := set{ r in producing_regions:
      export_ports[r] };<br>
          import_ports_set := set{ r in consuming_regions:
      import_ports[r] };<br>
      <br>
      Then you can define the routes with:<br>
      <br>
          routes := [export_ports_set, import_ports_set];<br>
      <br>
      4) You have already defined the ports as arrays over the regions,
      so you can make the lookup within this array. You don't need the
      set producing_regions_export_ports_correspondence:<br>
      <br>
          echo export_ports["Midwest"];<br>
      <br>
      will produce the output "NewOrleans".<br>
      <br>
      Thomas Schleiff<br>
      <br>
      <br>
      <br>
      Am 09.10.2017 um 11:57 schrieb Mike Steglich:<br>
    </div>
    <blockquote type="cite"
      cite="mid:B6A604B1-52E2-43A8-B751-B328B1561829@th-wildau.de">
      <div>Hello Richard,</div>
      <div><br>
      </div>
      <div>I aplolgise for the delayed answer. It is the beginning of
        the new winter semester ...</div>
      <div><br>
      </div>
      <div>Please see my answers below:</div>
      <div><br>
        Am 06.10.2017 um 21:46 schrieb Richard Males <<a
          href="mailto:males@iac.net" moz-do-not-send="true">males@iac.net</a>>:<br>
        <br>
      </div>
      <blockquote type="cite">
        <div>
          <p>Thank you for the availability of CMPL and the COIN-OR
            project.</p>
          <p>I am trying to learn the language by developing a model of
            port to port ocean transport with a relatively small set of
            ports (3 export serving 3 producing regions, 7 import
            serving 7 consuming regions) eventually leading to a larger
            and more complex situation.  I come from a programming
            language background.  I am using Coliop4.  <br>
          </p>
          <p>Any suggestions/advice much appreciated.<br>
          </p>
          <p>1) I have not found any tutorial information for beginners,
            only the documentation.  Is there anything like that
            available?</p>
        </div>
      </blockquote>
      <div>Unfortunatly, not yet. There are additional CMPL sample files
        in the SolverStudio package that could help .... -> <a
href="https://urldefense.proofpoint.com/v2/url?u=http-3A__SolverStudio.org&d=DwMCaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=bC-ot6cnDq3NJprIa2U54ZW0PXGvQSMdgN_s4GhXuu8&m=K-b1Y0toMDzL8qrD8mEkzPTJ9n5T6EAve5pAhb8Z8VE&s=gsdW7T_rbOwOwLPjedmbZW4IcaN_4SEM1ulJ3xk25So&e="
          moz-do-not-send="true">SolverStudio.org</a></div>
      <br>
      <blockquote type="cite">
        <div>
          <p>2) Is there a search function for the mailing list archive?<br>
          </p>
        </div>
      </blockquote>
      <div>Unfortunately ... no </div>
      <br>
      <blockquote type="cite">
        <div>
          <p> </p>
          <p>3)   I have sets for producing and consuming regions and
            import and export ports (see below). <br>
          </p>
          producing_regions := set
          ("SouthAmerica","Midwest","PacificNorthwest");<br>
          export_ports[producing_regions] :=
          ("Santos","NewOrleans","Seattle"); <br>
          consuming_regions := set("China", "Europe", "Mexico", "Japan",
          "SoutheastAsia","FSU-MiddleEast","Korea");<br>
          import_ports[consuming_regions] := ("ChinaIP", "EuropeIP",
          "MexicoIP", "JapanIP",
          "SoutheastAsiaIP","FSU-MiddleEastIP","KoreaIP");
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;"><br>
          </p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">I am interested in developing the set of
            routes between all possible port pairs without having to
            directly enumerate it, so that I could reference
            route("Santos","ChinaIP") for the specifics of a particular
            route.  Is there an easy way of doing this within CMPL?  I
            did it manually, as follows:</p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;"><br>
          </p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">routes := set(
            ["Santos","ChinaIP"],["NewOrleans","ChinaIP"],["Seattle","ChinaIP"],</p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">
            ["Santos","EuropeIP"],["NewOrleans","EuropeIP"],["Seattle","EuropeIP"],</p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">
            ["Santos","MexicoIP"],["NewOrleans","MexicoIP"],["Seattle","MexicoIP"],</p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">
            ["Santos","JapanIP"],["NewOrleans","JapanIP"],["Seattle","JapanIP"],</p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">
["Santos","SoutheastAsiaIP"],["NewOrleans","SoutheastAsiaIP"],["Seattle","SoutheastAsiaIP"],</p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">
["Santos","FSU-MiddleEastIP"],["NewOrleans","FSU-MiddleEastIP"],["Seattle","FSU-MiddleEastIP"],</p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">
            ["Santos","KoreaIP"],["NewOrleans","KoreaIP"],["Seattle","KoreaIP"]);</p>
        </div>
      </blockquote>
      <div><br>
      </div>
      <div>It is not possible to do that directly at the moment. I do
        that usually in Excel using SolverStudio/Cmpl.</div>
      <br>
      <blockquote type="cite">
        <div>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;"><br>
          </p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">4) I am also looking for the best way to
            formulate a lookup situation.  In this case, given the
            region, I wish to know the port.  I have created a
            correspondence parameter with 2-tuples, as follows <br>
          </p>
          <p style="-qt-paragraph-type:empty; margin-top:0px;
            margin-bottom:0px; margin-left:0px; margin-right:0px;
            -qt-block-indent:0; text-indent:0px;"><br>
          </p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">producing_regions_export_ports_correspondence:=set(["SouthAmerica","Santos"],["Midwest","NewOrleans"],["PacificNorthWest","Seattle"]);</p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;"><br>
          </p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">and I would like to be able, given
            "Midwest", to return "NewOrleans".  I can iterate over the
            set to find the value, e.g.:</p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;"># below finds correspondence by looping
            through all</p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">{ [i,j] in
            producing_regions_export_ports_correspondence:</p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">{i="Midwest": echo j;}</p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">}</p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">but I am hoping there is a more direct
            way of doing this.</p>
        </div>
      </blockquote>
      <div><br>
      </div>
      <div>I would it also formulate as you did it. </div>
      <br>
      <blockquote type="cite">
        <div>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;"><br>
          </p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">Thank you in advance.<br>
          </p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;"><br>
          </p>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;">Dick Males<br>
          </p>
        </div>
      </blockquote>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>Thanks,</div>
      <div><br>
      </div>
      <div>Mike</div>
      <br>
      <blockquote type="cite">
        <div>
          <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
            margin-right:0px; -qt-block-indent:0; text-indent:0px;
            -qt-user-state:0;"> </p>
          <pre class="moz-signature" cols="72">-- 
Richard M. Males
3319 Eastside Avenue
Cincinnati, OH 45208
USA
</pre>
        </div>
      </blockquote>
      <blockquote type="cite">
        <div><span>_______________________________________________</span><br>
          <span>Cmpl mailing list</span><br>
          <span><a href="mailto:Cmpl@list.coin-or.org"
              moz-do-not-send="true">Cmpl@list.coin-or.org</a></span><br>
          <span><a
href="https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cmpl&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=Axd0FVSisUT_OdEDVlxhf3NvdBaa93RFXxvaYiKoPpk&m=K4l9MsFAnb7IG8RLm1OmTljAU3p7_w-1dh0ed4FtXIw&s=IQZAtfLxw8ga3tsrVx7ihdZehHZvKIMKkzTpd_m9noY&e="
              moz-do-not-send="true">https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cmpl&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=Axd0FVSisUT_OdEDVlxhf3NvdBaa93RFXxvaYiKoPpk&m=K4l9MsFAnb7IG8RLm1OmTljAU3p7_w-1dh0ed4FtXIw&s=IQZAtfLxw8ga3tsrVx7ihdZehHZvKIMKkzTpd_m9noY&e=</a>
          </span></div>
      </blockquote>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Cmpl mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Cmpl@list.coin-or.org">Cmpl@list.coin-or.org</a>
<a class="moz-txt-link-freetext" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cmpl&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=bC-ot6cnDq3NJprIa2U54ZW0PXGvQSMdgN_s4GhXuu8&m=K-b1Y0toMDzL8qrD8mEkzPTJ9n5T6EAve5pAhb8Z8VE&s=O439QxXpwOlwDWYPu4PgpDbQ5UhP1cPl-dofJY1Wq7c&e=">https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cmpl&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=bC-ot6cnDq3NJprIa2U54ZW0PXGvQSMdgN_s4GhXuu8&m=K-b1Y0toMDzL8qrD8mEkzPTJ9n5T6EAve5pAhb8Z8VE&s=O439QxXpwOlwDWYPu4PgpDbQ5UhP1cPl-dofJY1Wq7c&e=</a> </pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>