Optaplan6.0.0Beta1:chaining-simpleScore OK, DRL Score corruption
by Paul T
Requirement:Equip to tasks scheduling.Earlier tasks may not exceed a waittime
to latest endtime for each job.
2 JOBs to plan each with 2 identical TASKs with only 1 EQUIPMENT anchor:
J1 comprises T1,T2 and J2 comprises T1,T2.
problem Fact: EQUIPMENT E1
planning Entity: TASK T1|duration=3|waittime=2 and
T2|duration=5|waittime=3
OptaPlan Schedule attempt
-------------------------
anchor(E1:T1J1,T1J2,T2J1,T2J2) - so T1J1 is pos1,T1J2 is pos2 etc :
timings are 3+3+5+5 and respective waittimes are 2,2,3,3
Rule: get latest ending task by JOB and punish if waittime is exceeded
between the tasks for that specific JOB.
J1 latestendtime=11 which is T2J1
J2 latestendtime=16 which is T2J2
Punish if any task endtime for JOB exceeds waittime (so for J1:
T2J1-T1J1=(11-6-2)*-1 = -3 (SOFT)
- I believe that the score function remembers J1,T2J1 in position 3 and
T1J1 in position 1 with SOFT score -3
OptaPlan Schedule attempt
-------------------------
anchor(E1:T1J1,T2J2,T2J1,T1J2) - so T1J1 is pos1,T2J2 is pos2 etc :
timings are 3+5+5+3 and respective waittimes are 2,3,3,2
Rule: get latest ending task by JOB and punish if waittime is exceeded
between JOBs
J1 latestendtime=13 which is T2J1
J2 latestendtime=16 which is T1J2
Punish if any task endtime for JOB exceeds waittime (so for J1:
T2J1-T1J1=(13-6-2)*-1 = -5 (SOFT)
- I believe that the score function remembers J1,T2J1 in position 3 and
T1J1 in position 1 with SOFT score -5
Score corruption seems to occur as the DRL scoring function has 2 identical
set of entities/values but with different score results!
J1,T2J1 in position 3 and T1J1 in position 1 with SOFT score -3
J1,T2J1 in position 3 and T1J1 in position 1 with SOFT score -5
What has happened is that J2 has swapped its tasks around which are not(?)
taken into account for a chaining DRL score function and
hence does not see them as different.
Q?: Am I correct in my assumption that the DRL score function has
insufficient data to compare for my requirement?
Q?: If so any ideas to resolve?
--
View this message in context: http://drools.46999.n3.nabble.com/Optaplan6-0-0Beta1-chaining-simpleScore...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 12 months
Erro : JAAS Authentication with Guvnor 5.5.0 and Authorization Error
by Zahid Ahmed
Hi,
I have run into a set of errors configuring JAAS Authentication for Guvnor. I have searched a lot on jboss community and for all the solutions nothing is working for me. I am getting either the login popup or I am getting "This User has no permissions setup". The Guvnor Manual is referring to jboss eap 5 and I am trying to do this on Jboss AS 7.1.
Note : I am unable to find login-config.xml file mentioned in the following link. http://docs.jboss.org/drools/release/5.5.0.Final/drools-guvnor-docs/html/... . Is guvnor deployment targeted only for JBOSS EAP 5.0 ?
Environment:
1. Guvnor 5.5.0.Final
2. JBOSS AS 7.1.0
Files Configured (Only these files I configured):
1. Standalone.xml
2. Guvnor.war/WEB-INF/beans.xml
3. Created users using "add-user.sh"
4. standalone/configuration/application-users.properties (attached).
5. standalone/configuration/application-roles.properties (attached)
6. standalone/configuration/management-users.properties
Configurations
Standalone.xml :
Only configured below tags. There's nothing else I changed for the purpose of JAAS Authentication and Guvnor Authorization. Added <security-domain name="drools-guvnor" cache-type="default"> to check if "other" is not working.
<security-domain name="other" cache-type="default">
<authentication>
<login-module code="Remoting" flag="optional">
<module-option name="password-stacking" value="useFirstPass"/>
</login-module>
<login-module code="RealmUsersRoles" flag="required">
<module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/>
<module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/>
<module-option name="realm" value="ApplicationRealm"/>
<module-option name="password-stacking" value="useFirstPass"/>
</login-module>
</authentication>
</security-domain>
<security-domain name="drools-guvnor" cache-type="default">
<authentication>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
<module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/>
<module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/>
<module-option name="realm" value="ApplicationRealm"/>
<module-option name="password-stacking" value="useFirstPass"/>
</login-module>
</authentication>
</security-domain>
Drools-guvnor.war.
1. beans.xml (Tried 4 different configs as suggested on community)
a. Config 1 (Attached "Config1 beans.xml" and Config1 error.txt) . Error "This User has no permission setup".
<security:IdentityImpl>
<s:modifies/>
<!-- JAAS based authentication -->
<security:authenticatorName>jaasAuthenticator</security:authenticatorName>
</security:IdentityImpl>
<security:jaas.JaasAuthenticator>
<s:modifies/>
<jaasConfigName>other</jaasConfigName>
</security:jaas.JaasAuthenticator>
<!-- SECURITY AUTHORIZATION CONFIGURATION -->
<!--
This is used to enable or disable role-based authorization. By default it is disabled.
-->
<guvnorSecurity:RoleBasedPermissionResolver>
<s:modifies/>
<guvnorSecurity:enableRoleBasedAuthorization>true</guvnorSecurity:enableRoleBasedAuthorization>
</guvnorSecurity:RoleBasedPermissionResolver>
b. Config 2 (Attached "Config2 beans.xml" and Config2 error.txt). Error "This User has no permission setup".
<security:IdentityImpl>
<s:modifies/>
<!-- JAAS based authentication -->
<security:authenticatorName>jaasAuthenticator</security:authenticatorName>
</security:IdentityImpl>
<security:jaas.JaasAuthenticator>
<s:modifies/>
<security:jaasConfigName>drools-guvnor</security:jaasConfigName>
</security:jaas.JaasAuthenticator>
<!-- SECURITY AUTHORIZATION CONFIGURATION -->
<!--
This is used to enable or disable role-based authorization. By default it is disabled.
-->
<guvnorSecurity:RoleBasedPermissionResolver>
<s:modifies/>
<guvnorSecurity:enableRoleBasedAuthorization>true</guvnorSecurity:enableRoleBasedAuthorization>
</guvnorSecurity:RoleBasedPermissionResolver>
c. Config 3 (Attached "Config3 beans.xml" and Config1 error.txt). Error (Same error as of Config 1) "This User has no permission setup".
<security:IdentityImpl>
<s:modifies/>
<!-- JAAS based authentication -->
<security:authenticatorName>jaasAuthenticator</security:authenticatorName>
</security:IdentityImpl>
<security:jaas.JaasAuthenticator>
<s:modifies/>
<jaasConfigName>other</jaasConfigName>
</security:jaas.JaasAuthenticator>
<guvnorSecurity:RoleBasedPermissionResolver>
<s:modifies/>
<guvnorSecurity:enableRoleBasedAuthorization>true</guvnorSecurity:enableRoleBasedAuthorization>
</guvnorSecurity:RoleBasedPermissionResolver>
<component name="org.jboss.seam.security.roleBasedPermissionResolver">
<s:modifies/>
<property name="enableRoleBasedAuthorization">true</property>
</component>
I HAVE ALSO ADDED THIS COMPONENT TAG found every where on forums to resolve this issue. I tried Tried without this also but at that time I get LOGIN screen which always says Incorrect User/Password.Is this required or <guvnorSecurity:RoleBasedPermissionResolver> is the only authorization config.
<component name="org.jboss.seam.security.roleBasedPermissionResolver">;
<s:modifies/>
<property name="enableRoleBasedAuthorization">true</property>
</component>
Kindly help me in this configuration. I can't find a single authentic document for my environment.
Regards,
Zahid
10 years, 12 months
email
by noor jalillah jeffri
noorjalillahjeffri(a)gmail.com
10 years, 12 months
Optaplanner - Multiday / Periodic Vehicle Routing Problems
by Raoul Cousins
I am interested in solving periodic vehicle routing problems and other
multi-day (but static and deterministic) vehicle routing variants.
These are similar to standard VRP except that not every customer is visited
each day. In some variants, the days to visit each node are chosen from
some predefined schedules; in others, each node has to be visited a
specific number of times over the course of several days.
Would Optaplanner be a good choice to model such problems? I know it's not
a very well-defined question, but I'm wondering if there would be any
serious difficulties modeling this type of problem before I dive into the
programming.
Thank you!
10 years, 12 months
Unexpected, Unclear, Unperiodic error
by abhinay_agarwal
I have a piece of code which builds the kbase, when i run it from my local
system as a java application with guvnor deployed, the code works fine.
When i try and access from the admin module, it calls the same method
readKnowledgeBase(), it works.
But, when i call the same piece of code
(the same method readKnowledgeBase()) from user module, no extra parameter,
the same changeset is being used, it throws the following exception.
java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:796)
at
org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:1103)
at
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:844)
at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:684)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:207)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:186)
at
com.infosys.fps.drools.adapter.DroolsAdapter.readKnowledgeBase(DroolsAdapter.java:58)
at
com.infosys.fps.feecommission.helper.GoalFeeCommissionHelper.calculateFee(GoalFeeCommissionHelper.java:189)
at
com.infosys.fps.feecommission.helper.GoalFeeCommissionHelper.processFee(GoalFeeCommissionHelper.java:167)
at
com.infosys.fps.feecommission.helper.GoalFeeCommissionHelper.processFeeCalculation(GoalFeeCommissionHelper.java:126)
at
com.infosys.fps.feecommission.helper.GoalFeeCommissionHelper.chargeGoalCreation(GoalFeeCommissionHelper.java:77)
at
com.infosys.fps.feecommission.helper.GoalFeeCommissionHelper.chargeFee(GoalFeeCommissionHelper.java:55)
at
com.infosys.fps.client.goal.service.EduGoalNeedsService.saveEducationNeeds(EduGoalNeedsService.java:932)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy57.saveEducationNeeds(Unknown Source)
at
com.infosys.fps.client.goal.delegate.EducationGoalDelegate.saveEducationNeeds(EducationGoalDelegate.java:217)
at
com.infosys.fps.client.goal.controller.EduGoalNeedsController.saveAfterGoalId(EduGoalNeedsController.java:865)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
at
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
at
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
at
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at
org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Server returned HTTP response code: 502 for
URL:
http://bbsrprd02:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Goal...
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)
at org.drools.io.impl.UrlResource.grabStream(UrlResource.java:210)
at org.drools.io.impl.UrlResource.getInputStream(UrlResource.java:146)
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:759)
... 85 more
Any idea about this weird behaviour ?
Thanks,
Abhinay
--
View this message in context: http://drools.46999.n3.nabble.com/Unexpected-Unclear-Unperiodic-error-tp4...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 12 months
What is the JBoss Knowledge Base Builder?
by Thomas Grayson
My Eclipse project includes the "JBoss Knowledge Base Builder." What does this builder do? I don't know how it was added to my project. Regardless, it does not automatically compile my rule files, as far as I can tell, since I didn't see any messages of that kind until I added the (different) "Drools Builder" to my project.
Tom Grayson
10 years, 12 months
Make Eclipse Drools Builder ignore .csv files
by Thomas Grayson
I have an existing Eclipse project that I just converted to a Drools project so that I could get the benefit of automatic compilation of my rule files and decision tables. This worked, but with an unfortunate side effect. My project also contains .csv files that are not Drools decision tables. The Drools Builder flags these files with an error. Can I configure my project so that the Drools Builder will ignore these files? If not, is there a good workaround? The .csv files open nicely in Excel, so I don't want to change the file extension unless I can get the same effect. I am using Drools 5.5.0.Final.
Best wishes,
Tom
10 years, 12 months
JPAKnowledgeService with ProtobufMarshaller
by Dilyan Dokov
Hi,
everybody.
Can I use Google's Protobuf instead of java.io.Serialization for automatic
knowledge session persistence?
I'm trying to figure this out for several hours now and I think I'm missing
something.
I'm using drools 5.5.0 and JPAKnowledgeService for automatic persistence of
the knowledge session in a mysql database. Ofcourse, there are backward
compatability problems because it is using vanilla java serialization. I can
see there is a ProtobufMarshaller implementation in the sources but can I
configure JPAKnowledgeService to use it instead.
Best regards,
Dilyan Dokov.
--
View this message in context: http://drools.46999.n3.nabble.com/JPAKnowledgeService-with-ProtobufMarsha...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 12 months
do I have to use temporary variable to overcome data casting issue ?
by Martin Minka
I continue to play with the code attached to
https://issues.jboss.org/browse/DROOLS-136 in src.zip. Updated invoice.drl
is attached in this mail.
I changed the rule "calculate totalPrice per item" to MVEL and trying to
calculate and set totalPrice with one liner:
((DataItemPrice)$v).setTotalPrice(((DataItemPrice)$v).getQty()*((DataItemPrice)$v).getUnitPrice());
but that fails with message: java.lang.IllegalArgumentException: object is
not an instance of declaring class
On the other hand using temporary variable of type Double will work. Here
is the complete rule which works up to the comment "// THIS IS DOESN'T
WORK":
rule "calculate totalPrice per item"
salience -10
no-loop
when
$q:Message(id=="item", answered==true,
value instanceof DataItemPrice, $v:value
)
then
System.out.println("setting totalPrice on item: " +
((DataItemPrice)$v).getName());
System.out.println("qty*unitPrice=" +
((DataItemPrice)$v).getQty()*((DataItemPrice)$v).getUnitPrice());
* Double d =
((DataItemPrice)$v).getQty()*((DataItemPrice)$v).getUnitPrice();
((DataItemPrice)$v).setTotalPrice(d);
* System.out.println("setting via temporary variable worked");
// THIS IS DOESN'T WORK
*
((DataItemPrice)$v).setTotalPrice(((DataItemPrice)$v).getQty()*((DataItemPrice)$v).getUnitPrice());
*
System.out.println("setting directly works ???");
update($q);
end
Am I again wrongly hoping that MVEL will simplify data types casting ? Or
should I fail a bug ?
10 years, 12 months