Re: [rules-users] CurriculumCourse - extending for multiple teachers per course

2013-11-24 Thread Geoffrey De Smet

  
  

On 22-11-13 23:38, clients wrote:


  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)

That's inside the construction heuristic configuration.
An entitySelector gets automatically generated there and
because there are multiple entities, it doesn't know which one you
mean.
I haven't documented yet how you can customize the CH configuration,
but here are some tips:
Follow the rabit hole down from ConstructionHeuristicSolverPhaseConfig and
  QueuedEntityPlacerConfig.
  The configuration looks something like this:
   constructionHeuristic
 queuedEntityPlacer
   entitySelector id="a"/
   changeMoveSelector
 mimicEntitySelector refId="a"/
 valueSelector
   /changeMoveSelector
 /queuedEntityPlacer
   /constructionHeuristic

Note: the mimic part is documented already.
Seeing that you have 2 planning entitie classes,
you can add 2 constructionHeuristic elements, and change the
entitySelector for each entity class.


  


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: http://drools.46999.n3.nabble.com/CurriculumCourse-extending-for-multiple-teachers-per-course-tp4026896.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




  

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] SolutionInitializer for Nullable Planning Variable

2013-11-24 Thread Geoffrey De Smet
Are you using 6.0.0.Final? There was a bug with nullable variables and 
CH's in 6.0.0.CR5 and earlier.

On 24-11-13 03:20, newbie wrote:
 I created a custom solver which assign planning variables to planning
 entities. I have a simple rule checking if  there are no assign variable
 that adds negative soft constraint. But when I assigned my planning variable
 it increases the negative score instead of reducing it. I have for example
 12 entities and my starting score was
 0/-12.But when I initialized it with 4 variables it increases to 0/-16.

 rule null variable

  when
   $myEntity : Entity( variable == null )
  then
   scoreHolder.addSoftConstraintMatch(kcontext, 0, -1);
 end



 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/SolutionInitializer-for-Nullable-Planning-Variable-tp4026901.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] SolutionInitializer for Nullable Planning Variable

2013-11-24 Thread newbie
Yes I am using now the latest version 6.0.0.Final.



--
View this message in context: 
http://drools.46999.n3.nabble.com/SolutionInitializer-for-Nullable-Planning-Variable-tp4026901p4026905.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] SolutionInitializer for Nullable Planning Variable

2013-11-24 Thread Geoffrey De Smet
In that case, can you create a new jira and attach any way I can 
reproduce the issue locally?
   https://issues.jboss.org/browse/PLANNER

On 24-11-13 14:50, newbie wrote:
 Yes I am using now the latest version 6.0.0.Final.



 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/SolutionInitializer-for-Nullable-Planning-Variable-tp4026901p4026905.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Drools Problems

2013-11-24 Thread Kumarshorav
Hi All,

I have deployed the rest service in Tomcat 7. When I am hitting the resource 
through browser; resulting is coming. But when I am sending continuous hit for 
the resource through CTRL+F5 or through Apache J Meter; it is throwing 
Exception:

Some errors exists in packageBuilder
[DialectError message='Unable to wire compiled classes, probably related to 
compilation failures:null']

Or some times -

Some errors exists in packageBuilder
[DialectError message='Unable to wire compiled classes, probably related to 
compilation failures:JavaDialect ']

But when I added core-3.4.2.v_883_R34x.jar in the class path; first  error 
message come up frequently.

I am using DroolsInitializer java class where different way of executing rules 
method is written.  I am also using some of your method; where in both cases 
same exception is coming up.

Please look on this.

Love

Kumar Shorav





Subject.drl
Description: Subject.drl


DroolInitialiser.java
Description: DroolInitialiser.java
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users