[Planner] How to fix score corruption (answer)
by Geoffrey De Smet
In the past few months, several users have reported on this mailing list
that they ran into score corruption issues,
so I've been working to improve the situation for 6.0.x.
Like in 5.x, by putting the <environmentMode> in ASSERT mode,
it's easy to detect such an issue (and often even the offending score rule),
but it's been generally hard to understand what's the cause on how to
fix it.
There are generally 3 common causes of score corruption:
* Bug in your cloning method.
o In 6.0.0.Beta1 you no longer need to write the cloning method:
+ http://blog.athico.com/2013/02/automatic-solution-cloning-in-planner.html
* Bug in the causes parameter you supply to ConstraintOccurrence or a
planner-incompatible hashcode/equals method of any those objects
o In 6.0.0.Beta1 there is no cause parameter and it no longer
cares about the hashcode/equals method of your objects during
score calculation
+ http://blog.athico.com/2013/04/score-drl-faster-and-easier-in.html
* Bug in our Drools Expert's statefull working memory
o Most of these bugs were fixed for Drools 5.1 and 5.2. I am not
aware of any in Drools 5.3 and 5.4.
+ Mario and I are looking into a very exotic bug in
5.5/6.0.0.Beta1 now, which is unlikely to affect you: it
only affects 1 dataset of 1 example in OptaPlanner.
o As always, we welcome detailed bug reports (especially with
reproducers) if you believe you 've discovered another bug.
Hope that helps :)
wkr,
Geoffrey De Smet
http://www.optaplanner.org
12 years, 11 months
planner: documentation about subChain-MoveSelectors
by roman.stumm
The only example that uses a SubChainChangeMoveSelector and a
SubChainSwapMoveSelector is the vehicleRoutingProblem. The
travelling-salesman-problem (which is another example for a problem with a
chained PlanningVariable) does not use them.
Is there a reason for this, e.g. what are the subChain*MoveSelectors for?
The documentation of drools-planner 5.5.0.Final does not say anything about
them,
see chapter 7.3.4. subChainChangeMoveSelector and 7.3.5.
subChainSwapMoveSelector
Regards,
Roman
--
View this message in context: http://drools.46999.n3.nabble.com/planner-documentation-about-subChain-Mo...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 11 months
Fact insertion & retraction in working memory
by jigna
I need to add rule for filtering an event for 30 seconds.
i.e. The action would be taken once event has occurred for the first time &
then all the events of the same type would be ignored 30 seconds
& action should again take place if event has occurred anytime after 30
seconds.
I have tried creating a Throote class for holding thrittle value & timestamp
of firts occurance of events.
Following are the three rules which I am creating for the same.
It works correctly with first two rules, however for triggering third rule,
I need to insert an event which is not '000000A1'
& then this would give result retarcting ThrottleInfo Object which is
holding timestamp of this event for which throttle period has passed.
How can I make third rule trigger when there is not event of type '000000A1'
after throttle period?
Also is it possible to simplify this & write in single rule using timestamp
or any other features of fusion?
import com.igate.iheal.model.ErrorInfo
import com.igate.iheal.model.ThrottleInfo
import com.igate.iheal.model.process.IHEALProcessModel
declare ErrorInfo
@role(event)
@timestamp(errorTimeStamp)
end
rule "Error Rule 1"
no-loop true
when
$Error1:ErrorInfo(errorCode=="000000A1")from entry-point ErrorEntryPoint
not(exists(ThrottleInfo(errorCode=="000000A1")))
then
#Passing throttle duration as 30 seconds
insert(new
ThrottleInfo("000000A1",30,System.currentTimeMillis()));
retract($Error1);
System.out.println("New throttle info instance created");
end
rule "Error Rule 2"
no-loop true
when
$Error2:ErrorInfo(errorCode=="000000A1") from entry-point
ErrorEntryPoint
exists(ThrottleInfo(errorCode=="000000A1"))
$ThrottleError:ThrottleInfo(errorCode=="000000A1")
eval($ThrottleError.isThrottleCompleted()==true)
then
modify($ThrottleError)
{setErrorTimeStamp(System.currentTimeMillis())};
retract($Error2);
System.out.println("Modified throttle info instance");
end
rule "Error Rule 3"
#no-loop true
when
$Error3:ErrorInfo(errorCode!="000000A1") from entry-point ErrorEntryPoint
not(ErrorInfo(errorCode=="000000A1"))
exists(ThrottleInfo(errorCode=="000000A1"))
$ThrottleError:ThrottleInfo(errorCode=="000000A1")
eval($ThrottleError.isThrottleCompleted()==true)
then
retract($ThrottleError);
System.out.println("Delete unused throttle info instance");
end
--
View this message in context: http://drools.46999.n3.nabble.com/Fact-insertion-retraction-in-working-me...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 11 months
shiftAssignment change
by john poole
I'm trying to write a simple web application that uses much of the code from
the NurseRostering example. It all works great except when I try to do a
"change move" after terminating solving.
In: DroolScoreDirector.afterVariableChanged() for the ShiftAssignment, I get
a null back from this:
FactHandle factHandle = workingMemory.getFactHandle(entity);
My guess is that it's because it's a different copy of the workingMemory
than the entity is coming from, but I'm not sure how to access the correct
copy.
I'm getting the ShiftAssigment from:
NurseRoster nurseRoster = (NurseRoster) solutionBusiness.getSolution();
List<ShiftAssignment>shiftAssignmentList=nurseRoster.getShiftAssignmentList();
and then attempting the move from:
solutionBusiness.doMove(new EmployeeChangeMove(shiftAssignment,
toEmployee));
Is there something else I need to do after terminating solving before doing
a changemove?
--
View this message in context: http://drools.46999.n3.nabble.com/shiftAssignment-change-tp4023179.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 11 months
service() for servlet PluginServiceServlet threw exception: java.lang.IllegalArgumentException: No plugin by the name of plugins
by saihegde
I need to change the designer context root to support multiple instances of
guvnor and thereby designer on the same server.
I did by changing the following files
guvnor.war/WEB-INF/jboss-web.xml - Change context root
guvnor.war/WEB-INF/beans.xml - Configure jcr repository location
guvnor.war/classes/preferences.properties - Configure designer context root
designer.war/WEB-INF/jboss-web.xml - Change context root
designer.war/profiles/jbpm.xml - Configure guvnor context root
The default one does come up fine, but the other fails to load the designer
with the following exception.
12:27:36,369 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/designer01].[PluginServiceServlet]]
(http--127.0.0.1-8
ervlet.service() for servlet PluginServiceServlet threw exception:
java.lang.IllegalArgumentException: No plugin by the name of plugins
at
org.jbpm.designer.web.plugin.impl.PluginServiceServlet.retrievePluginContents(PluginServiceServlet.java:93)
[classes:]
at
org.jbpm.designer.web.plugin.impl.PluginServiceServlet.doGet(PluginServiceServlet.java:71)
[classes:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
[jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
[jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.13.Final.jar:]
at
org.jbpm.designer.web.filter.impl.PluggableFilter.doFilter(PluggableFilter.java:70)
[classes:]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
[jbossweb-7.0.13.Final.jar:]
at
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
[jboss-as-web-7.1.1.Fina
1.1.Final]
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
[jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]
--
View this message in context: http://drools.46999.n3.nabble.com/service-for-servlet-PluginServiceServle...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 11 months
planner: Solver-Phase after a ProblemFactChange?
by roman.stumm
When the solver is in the localSearch phase and a problem-fact-change occurs:
will the solver jump back
into the construction-heuristics phase or continue with the local search?
Reason for my question: We have a (chained) vehicle-routing-problem with a
custom SwapMove- and ChangeMove-SelectionFilter that return 'false' for
some moves (on immovable planning entities, e.g. when a stop should be
pinned to a specific tour etc.), but the solver modifies them nevertheless
after a problem-fact-change?
--
View this message in context: http://drools.46999.n3.nabble.com/planner-Solver-Phase-after-a-ProblemFac...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 11 months