How to implement immovable planning entities for vehicle routing problem?
by Hagai
I am implementing a vehiclerouting like solution with OptaPlanner
6.0.1.Final.
According to the documentation for continuous planning, the way to 'lock'
parts of the solution is by declaring a movableEntitySelectionFilter on the
planning entity: Section 14.3.1. Immovable planning entities.
However, this does not work well with chained entities where parts of the
solution is calculated, like in the vehiclerouting example.
For example, let's assume the following chains, where [Customer A] and
[Customer C] are immovable:
[Vehicle 1] <- *[Customer A]* <- [Customer B]
[Vehicle 2] <- *[Customer C]* <- [Customer D]
Even if we filter immovable entities, a move to set the variable [Vehicle 2]
as previous standstill to [Customer B] can be selected with the following
result that changes the immovable entity [Customer C]:
[Vehicle 1] <- *[Customer A]*
[Vehicle 2] <- [Customer B] <- *[Customer C]* <- [Customer D]
A workaround is to filter moves with immovable entities as well as moves
with immovable variables (variables are also entities). However, this can
only work when immovable entities are placed at the beginning of chines
before any movable entities.
Is there a better way to implement immovable planning entities for vehicle
routing problem?
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-implement-immovable-planning-ent...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 6 months
part time intern @ Red Hat
by Mark Proctor
I have a small budget for a part time intern for one year, 12K USD. The work can be 100% remote, from almost any country. This will mostly be UI work, improving our workbench.
If this interests you, email me off list.
Mark
10 years, 6 months
Development lifecycle
by Branham, Jeremy [HR]
I am planning a new Drools architecture, and looking for the best way to migrate Drools rules through a series of environments.
Our typical SDLC involves an initial DEV environment, then migrating to one of several TEST environments, then to an ORT environment, then finally to a PROD environment.
The question has been asked a couple times, looking through the mail archives, but I'm curious if there have been any recent changes that could improve the development lifecycle.
I've read we could just use the import/export function, or the following two options -
Mentions Jackrabbit
http://article.gmane.org/gmane.comp.java.drools.user/25097/match=producti...
Using the Rest interface
https://community.jboss.org/wiki/PublishDroolsartifactsfromaproductionenv...
Anything else, or any best practice for this?
Thanks!
Jeremy D. Branham
Technology Architect
Sprint University Performance Support
Fort Worth, TX | Tel: **DOTNET
Office: +1 (972) 405-2970| Mobile: +1 (817) 791-1627
________________________________
This e-mail may contain Sprint proprietary information intended for the sole use of the recipient(s). Any use by others is prohibited. If you are not the intended recipient, please contact the sender and delete all copies of the message.
10 years, 6 months
Any form of "groub by" or "distinct" in accumulate/collect ?
by Ephemeris Lappis
Hello.
Perhaps that my question has few sense or none...
I've an object graph with say A, B and C.
A has one or many B, that has one or many C.
I can navigate through the relations between my objects in both direction.
For example, I can do fo any instance of C : c.b.a (or c.getB().getA())...
My initial input facts or only C objects, and I'd like to identify all the
distinct A instances, and insert them into my working memory, as they
participate to global rules.
I've been looking for some forms of accumulate or collect, but I've not
found a correct way to do it.
Some help ?
Thanks
Regards.
--
View this message in context: http://drools.46999.n3.nabble.com/Any-form-of-groub-by-or-distinct-in-acc...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 6 months
Multiple threads for KieBuilder
by RichardAmbridge
Hi,
We have over 20000 rules in our drools implementation. In drools 5 we
could build multiple packages in different threads and then create a
Knowledge base joining all those packages together.
e.g.
Thread:
knowledgeB = KnowledgeBuilderFactory.newKnowledgeBuilder();
knowledgeB.add(ResourceFactory.newReaderResource(new
StringReader(sb.toString())), ResourceType.DRL);
Then in the main compiler, once all threads have finished
KnowledgeBase knowledgeBase =
KnowledgeBaseFactory.newKnowledgeBase(conf);
for each thread:
knowledgeBase.addKnowledgePackages(thrds[t].getKnowledgeB().getKnowledgePackages());
I can't seem to find anyway to do that with the new KIE implementation.
What I would like to do is something like:
Thread:
Create sb to have lots of rules
KieServices kieServices = KieServices.Factory.get();
KieFileSystem kfs = kieServices.newKieFileSystem();
kfs.write("src/main/resources/rules.drl", sb.toString());
KieBuilder kieBuilder = kieServices.newKieBuilder(kfs);
kieBuilder.buildAll();
..check errors
KieContainer kieContainer =
kieServices.newKieContainer(kieBuilder.getKieModule().getReleaseId());
KieBase kieBase = kieContainer.newKieBase(kieBaseConfiguration);
In main compiling, create multiple threads, each with its own rule set.
Then when all threads completed, take all the kieBase objects and merge into
one base.
then KieSession ksession=mergedKieBase.newKieSession();
We compile our rules offline and then load into our running servers. The
compile server is a multicore server, but buildAll is single threaded.
Is this possible?
Many thanks for the support,
Ric
--
View this message in context: http://drools.46999.n3.nabble.com/Multiple-threads-for-KieBuilder-tp40294...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 6 months
Not able to use <kbase includes="" /> in Kie Spring
by Ashish Nayyar
Hi,
I am trying to include a another kbase in KIE Spring project. This is the
configuration
*knowledge-services.xml*
<kie:kmodule id="kie-spring">
<kie:kbase name="kie-base"
*includes="rules1Package"*packages="au.org.nps.dsaas.rules" >
<kie:ksession name="ksession1" type="stateless" >
<kie:consoleLogger />
</kie:ksession>
</kie:kbase>
</kie:kmodule>
<bean id="kiePostProcessor"
class="org.kie.spring.KModuleBeanFactoryPostProcessor"/>
*kmodule.xml*
<?xml version="1.0" encoding="UTF-8"?>
<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
<kbase *name="rules1Package"* packages="au.org.nps.dsaas.rules1" >
<ksession name="ksession2" type="stateless" />
</kbase>
</kmodule>
My KIE modules are discovered and I can see following in the logs
09:59:36,642 DEBUG
[org.drools.compiler.kie.builder.impl.ClasspathKieProject] (ServerService
Thread Pool -- 91) Found and used pom.properties
META-INF/maven/au.org.nps.dsaas/rules-repository/pom.properties
09:59:36,645 DEBUG
[org.drools.compiler.kie.builder.impl.ClasspathKieProject] (ServerService
Thread Pool -- 91) Discovered classpath module
au.org.nps.dsaas:rules-repository:0.0.1-SNAPSHOT
But Spring context fails to load and I get the following errors:
09:59:39,547 ERROR [org.drools.compiler.kie.builder.impl.AbstractKieModule]
(ServerService Thread Pool -- 91) Unable to build KieBase, could not find
include: rules1Package
As per the official documentation (
http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/ch.kie....)
, I can use the includes property of KBASE tag provided in Spring KIE. I am
using kie spring 6.1.0 Beta
Any suggestions?
Thanks
Ashish
10 years, 6 months
Drools Planner: what if possible values of a PlanningVariable are dependent of another one?
by Willem van Asperen
Hi All,
I have a PlanningEntity that has several planning variables, say A and
B. Now, if A is O then B can be X or Y and when A is P then B can be Y or Z.
I see two routes:
* create a solution property that generates X, Y and Z as alternatives
for B and rely on the score rules to dismiss improper values,
depending on the value of A
* create an entity property that only generates the possible values
for B (i.e. X,Y for A=O and Y,Z for A=P)
What is the best route?
(Alternatively I do not use the constructionHeuristic and just start of
my solution with a randomly (but correct) generated solution)
Regards,
Willem
10 years, 6 months
Restrict size/resource usage of drools session
by kurrent93
Hi
We have an application where users write their own rules via a UI, and these
are then translated into drl, and run in a dedicated drools session. Each
user can have one or more sessions.
However, there are times when something goes wrong - say a rule starts
looping - and it consumes all the resources - the server is running at 100%
cpu, and it then effects all users.
I realize we can optimize the the generated rules to prevent such issues,
and we are working on this - however am interested to know if there are any
ways - such as somehow sandboxing / restricting the resources that a drools
session can use, so that should a rule cause problems, it will not effect
the other running drools sessions.
Thanks for any advice on this problem.
--
View this message in context: http://drools.46999.n3.nabble.com/Restrict-size-resource-usage-of-drools-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 6 months