OptaPlanner - best strategy for variable number of planning entities?
by Nadim
Hi, I'm new to OptaPlanner, and reading through the planning examples in the
documentation left me with a question. One problem I'm trying to model
involves a variable number of planning entities, which I didn't really see
addressed by any of the examples; they all seemed to me more focused on
varying the states of planning variables for a fixed / known number of
entities.
To throw out some specifics...let's say I'm trying to optimize my attendance
schedule for some convention. I have a set of problem facts, the various
events going on at the convention, with each having a time (when the event
happens), and a worth (how much I'd like to be there for that event).
And I have a set of planning entities, the various times that I'm present at
the convention. So, I'm trying to model the case where my key constraint is
the total amount of time I spend at the convention...let's treat that as
fixed. I don't care how many separate times I go there, though I will have
to model constraints like a minimum length per visit (very inefficient to go
for 10 minutes at a time), and a minimum separation between visits (annoying
/ inefficient to leave, then turn right around and go back, unless I get an
hour break).
Again, I didn't see a good way to just say "have any number of planning
entities in the planning entity collection, so long as they meet the
constraints". So instead, I modeled the problem as a set of visits,
calculated as the max possible visits (total conference length / minimum
visit duration). Then I defined each visit to have three planning
variables: start time, duration, and whether that visit is "active". I'm
looking forward to 6.1, where it seems there's better support for numeric
ranges, but for now, just modeled start time as the set of integers
representing the time range of the convention in minutes. Finally, I
constructed a hard score based on the constraints above, and a soft score
that represents the sum of the worth of the events that occur during the
visit.
However, I'm not seeing it work out too well...the engine seems to spend a
lot of time messing around with one visit, and very little time trying out
multiple visits with different starts and durations to capture event-rich
times. I can certainly play around with parameters and engine
configuration, but I thought I should first ask if I was fundamentally going
about modeling the problem the wrong way, as I am very new to the
OptaPlanner engine.
Thanks in advance for any thoughts or suggestions!
--
View this message in context: http://drools.46999.n3.nabble.com/OptaPlanner-best-strategy-for-variable-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 1 month
dynamic rules creation/updation
by Kulbhushan Azad
hi All
i am new to Drools , was trying to explore drools for one of my project
requirements.
am looking if drools business rules can be stored ,retrieved and applied
from a relational database like oracle.
requirement is to provide end user capability to create/modify rules
dynamically without a need of code change.
appreciate if anyone can guide me to some information on this.
--
Thanks
Kulbhusan
12 years, 1 month
Drools Guvnor : Rule validation fails - Not finding any of the fields from the Fact
by mattmadhavan
Hello,
I have imported bunch of rules (.drl file) into the Guvnor. Then I imported
the Jar file containing the Facts and my Custom Operator and also the static
methods into the same "Guvnor
package of the rules.
When I try to validate the rules, I am getting errors saying that it is not
able to fund the given field in the Fact. None of the rules validate. They
always complain that what ever filed that is referenced in the Fact by the
rule, it doesn't exist.
Any ideas please?
Also how do I veiew/verify that my jar file was loaded OK . ( Can I
check/verify the model classes to see if they were loaded Okay?)
Also how do I delete unwanted/old model category or for that matter any
assets?
Thanks in advance
Matt'M
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Guvnor-Rule-validation-fails-Not...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 1 month
not in -Not working
by Gopu Shrestha
Here is the code snipet.
rule "Validation"
when
$claim: Claim($cos: claimIdentificationInfo.categoryOfService !=null);
$claimId: ClaimIdentification($cos not in ("01","03","04"), $cos.length >0);
then
log.info("Executing Rule: Validation .............");
end
Above code works if
- $cos in ("01","03","04")
-$cos.length
But when I put not in front of in ("not in"), it throws exception like this...
Unable to build constraint as '$cos' is invalid : [Rule name='Validation']
12 years, 1 month
High availability with a drools cluster
by Chakravarthi Muppalla
Hello All,
We are planning to user drools for our event driven business rules
execution. I’m designing this around the features available in Expert
engine, Fusion, Guvnor.
An overview of the system will look like this.
1.) 1.) We will have N application nodes with an embedded drools engine.
These nodes will be subscribed to the JMS(mostly ActiveMQ) and a clustered
cache.
2.) 2.) All the customer activities will be pushed onto the JMS. One of
these N nodes will get the customer activity event. This node will update
the cache (customer related data cache) with this activity.
3.) 3.) As all the nodes are connected to the cache, each one of them
will get a call back about the cache entry.
4.) 4.) If this is the first activity of the customer, One of the nodes
will act as a master to pick up this and insert this into the stateful
session’s working memory.
5.) 5.) Any further cache call backs related to this user will be sent
to this node.
In case one of the nodes go down, I want one of the other nodes to resume
the execution of the affected customers.
To translate this into drools, I want one of the nodes to pick up the
session of the failed node. As this is not available out of the box, I’m
looking for possible approaches.
I’m thinking of writing the working memory contents to a middle tier
cache(possibly radis) backed by persistence(mysql). This cache will write
the data to the persistence either at certain intervals or on certain
events.
I’m certain that other nodes can be notified, if one of the nodes go down.
So the question is, about the possibility to write/read the session to/from
a cache, pick up with session and seamlessly resume the execution. Are
there any practical approaches to store the working memory in a cache
instead of just the VM memory?
--
Cheers!
12 years, 1 month
Facing Problem with this exception
by Mallikarjun Kohalli (mkohalli)
Hi All,
We are getting the following exceptions when drools is executing some rules.
Exception:
Caused by: java.lang.NullPointerException
at org.drools.core.util.LeftTupleIndexHashTable.remove(LeftTupleIndexHashTable.java:251)
at org.drools.reteoo.NotNode.retractLeftTuple(NotNode.java:226)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateRetractLeftTuple(SingleLeftTupleSinkAdapter.java:217)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateRetractRightTuple(SingleLeftTupleSinkAdapter.java:124)
at org.drools.reteoo.JoinNode.retractRightTuple(JoinNode.java:151)
at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:232)
at org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteExpireAction.execute(ReteooWorkingMemory.java:412)
at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1471)
... 51 more
Regards,
Mallikarjun K
12 years, 1 month
Hi Wolf With respect to my prob u r saying it might the prob with drools version. i am using 5.1.1
by Mallikarjun Kohalli (mkohalli)
-----Original Message-----
From: Mallikarjun Kohalli (mkohalli)
Sent: Wednesday, March 05, 2014 2:54 PM
To: rules-users(a)lists.jboss.org
Subject: RE: rules-users Digest, Vol 88, Issue 12
Hi I am using drools 5.1.1
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of rules-users-request(a)lists.jboss.org
Sent: Wednesday, March 05, 2014 2:20 PM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 88, Issue 12
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of rules-users digest..."
Today's Topics:
1. Re: Drools template declaration in kmodule.xml (Michael Anstis)
2. Re: Guvnor - Custom operator problem (Not finding it)
(Michael Anstis)
3. Re: Drools 6.0.1 Workbench - How to import existing drl
files? (Michael Anstis)
4. Re: Some basic questions/assumptions on Drools
Work-bench/Guvnor (Michael Anstis)
5. Re: 6.0.1.F How to use @role and @expires with DSL
(Michael Anstis)
6. Re: Facing Problem with this exception (Wolfgang Laun)
----------------------------------------------------------------------
Message: 1
Date: Wed, 5 Mar 2014 08:06:26 +0000
From: Michael Anstis <michael.anstis(a)gmail.com>
Subject: Re: [rules-users] Drools template declaration in kmodule.xml
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<CAAG9P0suYi7MdP69nsNa4Y9S6c76nniZZ4u5QC72MO6zPTRLnA(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Hello,
I believe the KIE API doesn't supports your use-case.
You would normally use drools-templates pro grammatically: parse the template and interpolate your data. The resulting DRL would then be added to a KBase.
Templates within the Workbench work exactly the same (and uses drools-templates); however we persist the template and accompanying data as XML that KieBuilder (fortunately) knows how to convert to DRL.
With kind regards,
Mike
On 4 March 2014 22:24, david.berkman <david.berkman(a)grenadefish.net> wrote:
> Is there any way to declare a drools template (*.drt) and its data
> files (in tab delimited or csv or whatever) in a kmodule.xml for
> publication via Maven? I realize I can use the Workbench to create a
> 'similar' web template and deploy that as a consumable .jar file, but
> I get the impression that this web template is not quite the same as a
> drools template, and if I publish like that and disassemble the
> resulting jar, that the kmodule.xml present there (if there is one),
> would not reverse engineer and be applicable to my .drt + .csv files
> I'm currently loading programmatically.
> And although programmatic loading works, it's not available to
> monitoring by a KieScanner, and of dynamically loading any changes
> thereby. I can create my own monitoring and reloading system, but I'd
> rather not be reinventing the wheel.
>
> All help appreciated,
>
> Thanks,
> David
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-template-declaration-in-kmodu
> le-xml-tp4028504.html Sent from the Drools: User forum mailing list
> archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
12 years, 1 month