<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">Op 11-12-12 22:25, Willem van Asperen
      schreef:<br>
    </div>
    <blockquote cite="mid:50C7A4D3.7050900@van.asperen.org" type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      Hi All,<br>
      <br>
      I have a PlanningEntity that has several planning variables, say A
      and B. Now, if A is O then B can be X or Y and when A is P then B
      can be Y or Z.<br>
      <br>
      I see two routes:<br>
      <ul>
        <li>create a solution property that generates X, Y and Z as
          alternatives for B and rely on the score rules to dismiss
          improper values, depending on the value of A</li>
      </ul>
    </blockquote>
    I recommend this (not just because of [1], but because it allows
    certain heuristics (SA for example) to temporary break the hard
    constraint to "tunnel through those hard constraints").<br>
    <br>
    Several ways to implement:<br>
    - generate all valid A-B combinations in getProblemFacts() (see
    manual section "cached problem facts") and do something like<br>
    when<br>
    &nbsp; MyEntity(a, b)<br>
    &nbsp; not ABCombo(same a, same b)<br>
    then<br>
    &nbsp; // bad, possibly get weight from ABCombo<br>
    end<br>
    - add a method on my MyEntity:<br>
    when<br>
    &nbsp; MyEntity(a, b, aAndBCompatible = false)<br>
    then<br>
    &nbsp; // bad<br>
    end<br>
    <br>
    Dependending on the difficulty of the domain, moveSelectionFilter
    and/or moveSelectionProbability could be helpful to optimize the
    selected moves.<br>
    The default swap move already swaps all vars by default, so that's
    good.<br>
    <br>
    <blockquote cite="mid:50C7A4D3.7050900@van.asperen.org" type="cite">
      <ul>
        <li>create an entity property that only generates the possible
          values for B (i.e. X,Y for A=O and Y,Z for A=P)</li>
      </ul>
    </blockquote>
    [1] Entity property is supported in 5.5 currently. (see
    documentation warning at the start of that section).<br>
    <blockquote cite="mid:50C7A4D3.7050900@van.asperen.org" type="cite">
      <ul>
      </ul>
      <p>What is the best route?<br>
      </p>
      <p>(Alternatively I do not use the constructionHeuristic and just
        start of my solution with a randomly (but correct) generated
        solution)<br>
      </p>
      <p>Regards,<br>
        Willem<br>
      </p>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>