Fwd: Retrieving constraints based on a manual solution
by Sreeni Maheshwaram
>
> Hi,
>
> Could you please advise:
>
> I am using the Drools Planner (5.5) to a) optimize the solution and get
> best
> solution b) allow the manual solution and resolve the conflicts, based on
> the business requirement.
>
> 1. scenario a is straight forward. I could run the solver, get the best
> solution, set it to the ScoreDirector as working solution, get the
> constraints from the working memory.
>
> 2. in scenario b, I do not want to run the solver for best solution. When I
> set the manual solution as a working solution on the ScoreDirector, I could
> not get the constraints.
>
> As a work around, either I have to run the solver in scenario b for some
> time to get the constraints, which I can not afford and I do not think the
> constraints relate to the manual solution.
>
> Is there a way to get cosntraints based on the manual solution without
> running the solver?
>
> regards,
> Sreeni
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Retrieving-constraints-based-on-a-manua...
> Sent from the Drools: User forum mailing list archive at Nabble.com.
>
>
--
Thanks, Sreeni M
--
Thanks, Sreeni M
13 years, 6 months
unmarshal global variable
by acormond
Gentlepeople,
I am fairly new to Drools and have what I hope is a simple question. I am
attempting to marshal (serialize) a Drools knowledge session and then
unmarshall it. The marshalling works but the unmarshalling fails with a
null pointer exception. The error is apparently with unmarshalling a global
variable in the session.
The session is created from a spreadsheet (decision table). This
spreadsheet
has two RuleTables. The first of these exists solely so that I can enter
some
constants into the session, specifically the name and price of the product
the
spreadsheet is dealing with. The second ruletable is where the rules are
specified. The exception occurs when unmarshalling the first rule in the
first
rule table. If, as a test, I eliminate the first rule table, then I can
successfully marshal and unmarshall the session.
The marshalling is done using the following, simplified, code:
Marshaller marshaller = MarshallerFactory.newMarshaller(kbase);
File droolsSessionFile = new File(MARSHAL_FILE);
foStream = new FileOutputStream(droolsSessionFile);
baos = new ByteArrayOutputStream();
marshaller.marshall(baos, ksession);
baos.writeTo(foStream);
and the unmarshalling is done like this:
Marshaller marshaller =
MarshallerFactory.newMarshaller(pricingProcessor.getKnowledgeBase());
FileInputStream fis = new FileInputStream(MARSHAL_FILE);
StatefulKnowledgeSession ksession = marshaller.unmarshall(fis);
So, where did I go wrong? Perhaps I need to deal with the global variable
differently, perhaps by putting it in the knowledgeBase before I unmarshall
the session?
Thank you for any help.
Alex Ormond
--
View this message in context: http://drools.46999.n3.nabble.com/unmarshal-global-variable-tp4021375.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
Correlating 2 independent streams of events
by Esteban Aliverti
Let's say I have two independent streams of different events: EventA and
EventB. Which is the best way to get all the occurrences of EventB that
happened between the last 3 occurrences of EventA?
For example:
from:
$b1:EventB, $a1:EventA, $b2:EventB, $b3:EventB, $a2:EventA,
$b4:EventB, $b5:EventB, $a3:EventA, $b6:EventB
I would like to get $b2, $b3, $b4, $b5
Best Regards,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
- Blog @ http://ilesteban.wordpress.com
13 years, 6 months
Finding matching values in composite constraint
by bdolbeare
Is there a way to determine (in the rule consequence) which condition in a
composite constraint caused a rule to succeed?
I am working on a system that allows users to create rules via a custom UI
and when one of their rules fires, I want to be able to create a message
that describes why their rule fired. In a real example, they might have a
list of a few hundred conditions in a composite constraint.
An example rule with just two conditions in a composite constraint follows:
rule "test rule"
when
MyObject( (myfield str[startsWith] "a" || myfield str[startsWith] "b") )
then
System.out.prinltn(kcontext.getRule().getName() + " fired because myfield
started with ???");
end
Is this exposed somewhere in the variables like kcontext that are available
to each rule in their consequence?
--
View this message in context: http://drools.46999.n3.nabble.com/Finding-matching-values-in-composite-co...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
Drools Fusion and Twitter Storm
by karlunho
Hi Folks,
I'd like to hear about any stories of using Drools in combination with
Twitter's Storm <http://storm-project.net/> .
The problem that I'm trying to solve is making a highly scalable event
processing system with the following properties:
1. Lots of events for the same timeframe - that means if the events expire
within 30 minutes, there are too many events to compute in a 30 minute
period for a single node
2. Fault tolerant - Meaning that if a node goes down, event processing will
not be affected or data will not be lost.
3. Perform Aggregates across large number of events
Has anyone tried to integrate the two systems ? There are a couple of
thoughts that I have why the two would be a nice match:
1. Twitter Storm seems to take care of most of the distributed processing
problem. Specifically, it allows for generating partial aggregate on
multiple nodes, followed by creating complete aggregates across nodes. Kind
of like a streaming map-reduce system.
2. Drools seems to have better a better language for event processing -
especially when there are layers and layers of business rules.
3. Drools Guvnor allows on-the-fly modification of rules - this is a huge
limitation of Twitter storm because it does not allow on-the-fly
modification of event processing topologies.
Let me know what everyone thinks (or if anyone has implemented this) !
The system I'm planning to apply this to is a mobile analytics system where
we are collecting network traffic and log data across potentially millions
of smartphones in real-time.
Regards,
Alan Ho
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Fusion-and-Twitter-Storm-tp40213...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
Re: [rules-users] debug
by Kevin Kelleher
Hi All,
I'm wondering what the status is re this "debug not working" drools issue.
It's been out there for quite a while now. It would be great to get feedback
re this.
Folks out there must be using 5.5.0 core, so I'm wondering how they are
coping this issue.
Regards,
Kevin
--
View this message in context: http://drools.46999.n3.nabble.com/debug-tp3889772p4021336.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
Planner: How to Set Global Varaiables
by jonathan.labin
I see in the documentation for Drools Expert a description of how to set
global variables through the API via a StatefullKnowledgeSession or
StatelessKnowledgeSession.
How is this achieved when using the Drools Planner? I have a solver
instance that is created from a XmlSolverFactory (as shown in the examples).
Is there a sequence of getters calls originating at the Solver instance that
ultimately gets to the ksession on which setGlobal can be called?
--
View this message in context: http://drools.46999.n3.nabble.com/Planner-How-to-Set-Global-Varaiables-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months