Re: [rules-users] Unable to upload POJO model jar to Guvnor 5.3.1 on Glassfish 3.1.2
On June 1st, claz12 wrote: "when I try to upload the model jar file, I get the error 'Unable to to upload the file' message box displayed." I was able to reproduce this problem on Guvnor 5.4 / Tomcat 7 -- and uploading a JDK1.7 compiled Jar. The HTTP response suggested that the Java version was wrong. I produced 1.6 java, and it was able to upload successfully. I suppose it probably would be best to show the precise error message to the user. Jon -- View this message in context: http://drools.46999.n3.nabble.com/Unable-to-upload-POJO-model-jar-to-Guvnor-5-3-1-on-Glassfish-3-1-2-tp4017722p4017931.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] Planner - Initialized solution & local search
I'm using v5.4. I've built a prototype which uses the constructionHeuristic, and localSearch, as the example does, and am able to run the solver (though it still doesn't do a good job of solving at this point). I've now added customSolverPhase, and set it to use an initializer class which implements CustomSolverPhaseCommand. In my changeWorkingSolution, I call scoreDirector.beforeEntityAdded(), and then set the planning entity's planning variable, and then call afterEntityAdded(). If I leave any entities unadded -- and let the constructionHeuristic (BEST_FIT, etc) do the fitting (which I can verify from the logs)-- I then get this exception: /java.lang.IllegalStateException: Phase localSearch started with an uninitialized Solution. First initialize the Solution. For example, run a phase constructionHeuristic first./ For now, I can update my code to ensure that all of the entities are fitted and bypass the constructionHeuristic, but I'm curious why this error is getting thrown. I did hunt through the source code to look at all the isInitialized() methods, but I haven't yet stepped through to see which one returns false any why. As for turning on TRACE mode, see my http://drools.46999.n3.nabble.com/drools-planner-5-4-0-Final-java-lang-IllegalStateException-Score-corruption-the-workingScore-tp3981199p4018558.html recent post . Jon -- View this message in context: http://drools.46999.n3.nabble.com/Planner-Initialized-solution-local-search-tp4018594.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] Score curruption exception in drools-planner-5.4.0.CR1
Right, the root of the behavior is that TRACE enables assertWorkingScore(), which tells me that the workingScore (reflecting the score after the move) is not the same as the uncorruptedScore (reflecting prior to the change), and specifically, that 4 ConstraintOccurrences are mismatched. For some reason, new I looked, along the lines of Christopher's earlier suggestion, that equals() was the issue, but it was not. It just appears that insertLogical() is not replacing the ConstraintOccurences that were associated with the PlanningVariable's class. Jon -- View this message in context: http://drools.46999.n3.nabble.com/drools-planner-5-4-0-Final-java-lang-IllegalStateException-Score-corruption-the-workingScore-tp3981199p4018599.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] Planner - Initialized solution & local search
re: /Double check if you aren't calling afterEntityAdded() on the non-initialized entities too. Also check that the construction heurstics run before the localSearch solver does (the order in which they are declared in the config xml matters)./ Checked both. I'll file a JIRA bug, but I'm just searching the source some more -- I'm trying to verify that DefaultGreedyFitSolverPhase.solve() doesn't exit the loop before calling setSolutionInitialized(). Jon -- View this message in context: http://drools.46999.n3.nabble.com/Planner-Initialized-solution-local-search-tp4018594p4018605.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] Planner - Initialized solution & local search
I figured out the problem. DefaultSolver.runSolverPhases() will go through each phase, and will revert the changes if they're not better. Or, more exactly, here are lines 191-193: if (it.hasNext()) { // solverScope.setWorkingSolutionFromBestSolution(); } Now, if this involved setting the planning variables for the first time, those will be reverted. There's a few ways of tackling this, some of which are on the user end, such as a adding a hard constraint to penalize the solution if the planning variable isn't set. Jon -- View this message in context: http://drools.46999.n3.nabble.com/Planner-Initialized-solution-local-search-tp4018594p4018642.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] Planner 5.4 - Overriding CachedMoveFactory to skip some PlanningEntity instances
my error here in looking to extend CachedMoveFactory. Obviously, the moves are cached, and not regenerated each forage. I suppose if I wanted to achieved what I wanted, I'd just override isMoveDoable() to make it more discerning -- but,as the JavaDoc suggests, there's little benefit to doing this. I'd be putting business logic into Java that would be redundant to the rules, with little performance gains. -- View this message in context: http://drools.46999.n3.nabble.com/Planner-5-4-Overriding-CachedMoveFactory-to-skip-some-PlanningEntity-instances-tp4018561p4018667.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] Planner - IntConstraintOccurrence not being retracted
I've been building a prototype similar to CloudBalancing. I've got IntConstraintOccurrence objects being inserted via insertLogical() through my rules. For some reason, I don't think these are being retracted as expected -- the count() of accumulated IntConstraintOccurrence's ramps up to 10x what I expected to be (and the sum of weights is similarly 10x what I expect). Also -- I have enabled Drools debugging, but I don't see the Audit Logs. any ideas? Jon -- View this message in context: http://drools.46999.n3.nabble.com/Planner-IntConstraintOccurrence-not-being-retracted-tp4018672.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] Planner - IntConstraintOccurrence not being retracted
Rookie error -- I neglected to put the modify() in the RHS of a rule. That'll make a big difference. :-) -- View this message in context: http://drools.46999.n3.nabble.com/Planner-IntConstraintOccurrence-not-being-retracted-tp4018672p4018710.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] Drools Planner changing problem fact
last month, Ralph wrote: /All the examples in the drools-planner-examples seem to have a fixed list of problem facts (rooms, teachers, timeslots) which only should be combined optimally./ Just to address this one unanswered point. The Cloud Balancing example does support changing the problem facts, specifically by removing computers (bins). The last section of the planner documentation (section 12.4) addresses realtime planning, through the Solver.addProblemFactChange() API. This works whether you are removing problem facts (as the example shows) or modifying their contents. This generally restarts the Solver -- but, if you are relatively optimized, the adjustment is found relatively fast. (I'm curious, though -- does the Solver expressly prioritize doing moves associated with those problem facts that were just changed?) -- View this message in context: http://drools.46999.n3.nabble.com/Drools-Planner-changing-problem-fact-tp4018087p4018742.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] modifying the problem facts while running the solver - Drools Planner
spinjala wrote > > 1) When a solution violates all constraints, does it provide a default > solution? If so, can it be changed so that it doesn't provide one? > Otherwise, is there a way to assure that no solution is generated when ALL > constraints are violated. > Let's walk through the code. Solver.solve() will look for solutions until any of the conditions specified by the termination configuration are met. These could be based on time, or score, etc. In your case, your best solution will have a negative hard score. You would find this via: Solution Sol = solver.getBestSolution(); if (Sol.getScore().getHardScore() == 0) { // no constraints are violated } else { // Sol = null } spinjala wrote > > 2) When a feasible solution is not generated, is it possible to make a > custom solution as the most relevant solution instead of the generated > one? For ex. if the solution generated by Drools planner assigned a work > order WO2 to a resource R1, is it possible to create a custom solution > that assigns it to, possibly R2? > Sharpen your grammar here. Your first sentence's first clause says that the feasible solution is not generated, but the last clause references "the generated one." So who (or what) is making this custom solution? Remember that the Solution is your class. You are free to write your own code to fill it on your own via your own code (or user actions). Jon -- View this message in context: http://drools.46999.n3.nabble.com/modifying-the-problem-facts-while-running-the-solver-Drools-Planner-tp4019099p4019154.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] Rule flows in Drools planner configuration?
spinjala wrote > > Is it possible to have a rule flow file that defines a set of rules > (constraints) but executed in the order per the defined ruleflow.? I dont > see any example doing that so I was wondering if it is possible at all to > have the constraints defined with a rule flow file instead of single .drl > file? > I guess that the challenge here is that a rule flow file awaits startProcess() to be fired. Planner's DroolsScoreDirector.calculateScore() only calls fireAllRules(). Jon -- View this message in context: http://drools.46999.n3.nabble.com/Rule-flows-in-Drools-planner-configuration-tp4019143p4019160.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] modifying the problem facts while running the solver - Drools Planner
spinjala wrote > > I tried setting the scoreAttained and maximum time allowed to spend in my > termination configuration, but none seems to stop the solver finding the > solution that violates ALL constraints and hence throws a negative hard > score. Is this the only way to do it or any other way is available to > force the solver not to look for a solution when ALL constraints are > violated? > >From Planner's perspective, there are multiple possible solutions. Each solution has a score, a combination of the hard and soft scores, each of which represents the sum of constraint violations. If the scores are <0, then the solution is nonoptimal; and thus, it will keep looking. You might try the termination/maximumUnimprovedStepCount config setting. (see section 6.6.4 of the doc) This stops the solving after a number of steps have been tried without any improvement to the score. Jon -- View this message in context: http://drools.46999.n3.nabble.com/modifying-the-problem-facts-while-running-the-solver-Drools-Planner-tp4019099p4019161.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] Any additional (better) documentation for the examples included in Drools Planner product?
spinjala wrote > > We have been having real hard time understanding the examples with such > limited/no documentation about the examples that are included in the > product. Did someone find any other documentation on them apart from the > 5-6 paragraphs mentioned in the reference manual? Also, we found the > reference manual not detailed/ easy enough for us to delve into the > product to understand its features better. The biggest question is , Is > this product production ready and supported by Redhat yet? > Did you see the reference manual here: http://www.jboss.org/drools/documentation Which are the 5-6 paragraphs you are referring to? I'll concede that there could be shorter summaries of the manual for getting started. Jon -- View this message in context: http://drools.46999.n3.nabble.com/Any-additional-better-documentation-for-the-examples-included-in-Drools-Planner-product-tp4019149p4019163.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] modifying the problem facts while running the solver - Drools Planner
spinjala wrote > > THis is what is happening now with my sample solution that I am writing.. > Once the solver finds that a workorder (WO1) couldn't be assigned to any > resource in the list of resources (due to the constraints)... Well, it's a slightly different problem them. Planner's approach is to solve problems in parallel, where it's not trivial to determine where a given item can be matched. Part of the motivation beyond using Planner is that whether one item fits may be dependent on how the other items are arranged. If workorders are coming in one at a time, why not apply the rules to that item alone -- and that remove it from the planning scenario if it can't be fit? Jon -- View this message in context: http://drools.46999.n3.nabble.com/modifying-the-problem-facts-while-running-the-solver-Drools-Planner-tp4019099p4019264.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