<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">On 22-11-13 23:38, clients wrote:<br>
    </div>
    <blockquote cite="mid:1385159927327-4026896.post@n3.nabble.com"
      type="cite">
      <pre wrap="">Hi, 

I have been playing around with the optaplanner library for the past couple
of weeks trying to learn a bit of the basics. I have been making some
progress but I have a simple variation I am trying to accomplish to the
stock CurriculumCourse example and am hitting a wall. 

What I am trying to do is modify the CurriculumCourse example to also allow
the teachers to be planning variables. I plan on extending it to give
constraints on which courses individual teachers can teach, but to start I
am just assuming each teacher can teach any class to make things easier. 

- First I tried to add the Course entity as a second planning entity with
the teacher being a PlanningVariable but keep on running into an exception
based on the solver configuration

java.lang.IllegalArgumentException: The entityPlacerConfig
(QueuedEntityPlacerConfig(null, null)) has no entitySelector configured and
because there are multiple in the planningEntityClassSet ([class
org.optaplanner.examples.curriculumcourse.domain.Lecture, class
org.optaplanner.examples.curriculumcourse.domain.Course]), it can not be
deducted automatically. at
org.optaplanner.core.config.constructionheuristic.placer.EntityPlacerConfig.deduceEntityDescriptor(EntityPlacerConfig.java:43)</pre>
    </blockquote>
    That's inside the construction heuristic configuration.<br>
    An &lt;entitySelector&gt; gets automatically generated there and
    because there are multiple entities, it doesn't know which one you
    mean.<br>
    I haven't documented yet how you can customize the CH configuration,
    but here are some tips:<br>
    <p>Follow the rabit hole down from <a
href="https://github.com/droolsjbpm/optaplanner/blob/master/optaplanner-core/src/main/java/org/optaplanner/core/config/constructionheuristic/ConstructionHeuristicSolverPhaseConfig.java"
        rel="nofollow">ConstructionHeuristicSolverPhaseConfig</a> and
      QueuedEntityPlacerConfig.<br>
      The configuration looks something like this:</p>
    <pre><code>   &lt;constructionHeuristic&gt;
     &lt;queuedEntityPlacer&gt;
       &lt;entitySelector id="a"/&gt;
       &lt;changeMoveSelector&gt;
         &lt;mimicEntitySelector refId="a"/&gt;
         &lt;valueSelector&gt;
       &lt;/changeMoveSelector&gt;
     &lt;/queuedEntityPlacer&gt;
   &lt;/constructionHeuristic&gt;
</code></pre>
    Note: the mimic part is documented already.<br>
    Seeing that you have 2 planning entitie classes,<br>
    you can add 2 &lt;constructionHeuristic&gt; elements, and change the
    &lt;entitySelector&gt; for each entity class.<br>
    <br>
    <blockquote cite="mid:1385159927327-4026896.post@n3.nabble.com"
      type="cite">
      <pre wrap="">


I can't seem to figure out where the entitySelector is missing or what the
entityPlacer is used for or where it is configured. I have read that
multiple planning entities are possible, but can't determine how to get this
*simple* example to work.

- Second I tried to see if i could move the teacher planning variable to the
Lecture planningEntity, but cant figure out a way to keep all of the
lectures of one course stuck with the same teacher. I dont believe I can
change other planning entities on my own when one is updated.

I am still new to looking at these problems and determining the best model
to fit it, so hoping someone might have some tips/help on how to handle this
scenario.

Thanks in advanced,



--
View this message in context: <a class="moz-txt-link-freetext" href="http://drools.46999.n3.nabble.com/CurriculumCourse-extending-for-multiple-teachers-per-course-tp4026896.html">http://drools.46999.n3.nabble.com/CurriculumCourse-extending-for-multiple-teachers-per-course-tp4026896.html</a>
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
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>