drools-solver (initialization and starting score)
by Andrew Waterman
Hi,
I've been looking through my solver logs and on a problem i have
posed, the solver seems to first initialize and setup a best score:
INFO: Initialization time spend (3) for score (-5000004.0). Updating
best solution and best score.
However, this score is not correct. I use collect to load Tokens of a
certain type for my game, and those that are found, penalize the
system with a constraint:
rule "Too much unclaimed territory"
when
$list : ArrayList ( size > 2) from collect (
Token ($type : type == TokenType.UNDEVELOPED))
then
for (int i = 0; i < $list.size(); i++) {
insertLogical (new IntConstraintOccurrence (
"Too much unclaimed territory",
ConstraintType.NEGATIVE_SOFT, 3, $list));
}
end
However, the initial score does not seem to account for these
inserted facts. Due to this, all improving solutions are rejected,
and I see no change in the solution the solver finds and my starting
solution.
Any suggestions on how to delay initialization? Or get the starting
score to take into account this constraint (I've made it SOFT so the
values aren't so hard to follow in the logs, it was initially a HARD
constraint). I'd love to find a way around this problem, I've spent
most of the day playing with different configurations (acceptors and
foragers) trying to find a configuration that works for this base
problem.
best wishes,
Andrew
---------------------------------
Andrew Waterman
San Cristóbal de las Casas, Chiapas, Mexico
+52 1 967 107 5902
+1 510 342 5693
15 years, 9 months
Rule Templates and Guvnor
by Vikrant Yagnick
Hi All,
I was wondering if there is any support for Rule Templates directly in Guvnor. I haven't been able to find anything in the official documentation or by playing around Guvnor.
Does someone have any ideas as to how one would store templates in Guvnor?
Cheers,
Vikrant Yagnick
Software Designer - CLICO
MajescoMastek Ltd | Mastek Millennium Center,Millennium Business Park, Mahape, Navi Mumbai 400-710 |
(T) 91 22 66952222 Extn - 5230 | Mobile: +919833490598 | www.mastek.com
MASTEK LTD.
Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 years, 9 months
re:KnowledgeAgent and Guvnor
by J Michael Dean
So I build the KnowledgeBase with a url, and I can change the polling
interval from the default 60 with a property. The final piece of this
is the local cache directory that covers the situation of not being
able to connect to Guvnor. Sorry for my confusion.
- Mike
Message: 5
Date: Tue, 17 Feb 2009 23:14:45 +0000
From: Mark Proctor <mproctor(a)codehaus.org>
Subject: Re: [rules-users] KnowledgeAgent and Guvnor
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID: <499B44E5.7020509(a)codehaus.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
J Michael Dean wrote:
> RuleAgent could be fed a properties file that included a URL enabling
> connection to Guvnor. I cannot find any examples of using a
> KnowledgeAgent to connect to Guvnor - can someone point me in the
> right direction? Thank you.
If you build a KnowledgeBase using urls an then pass that KnowledgeBase
to the agent the agent will grab the urls and start scanning. If you
don't supply, or supply an empty knowledgebase, you use the
applyChangeSet(...) method which allows you t specify a Resource that
provides the changeset.xml which is where you place your urls.
The KnowledgeAgentFactory, KnowledgeBuilder and ChangeSet should all
provide some information on this.
Mark
15 years, 9 months
Re: Concurrency Issues with JavaDialectConfiguration
by Dave Klein
Edson,
Thanks for the fast reply. My co-worker is trying to reproduce this in a
sample app that we could show you. If we can get to that point I'll post
it.
I do believe we are compiling the rules each time. We are building our
application with Grails and using a plugin for Drools. So, we don't have
very much control over how we are using it. I will look into the source of
the plugin to see if I can tell what it is doing.
If that is what it is doing, should it be?
Thanks again,
Dave
15 years, 9 months
Maintaining state across invocations
by ober0n
Hi, I am a total newb to Drools and am still trying to get a clear picture of
how things work. I have the HelloWorld example running in Eclipse and am
trying to modify it.
What I'd like to do is write a program that passes single events over a set
of rules I defined in Drools. Obviously I don't know these events ahead of
time and I don't know when they will be reported.
Another important point is that I want each of these calls to be a stateful
transaction, for example:
1) Some event type A happens and is passed through drools: Rules say to
ignore the event
2) Some time later, and event type B happens and is passed through drools:
Rules say to ignore the event
3) Then, some time later, another event type A happens and is passed through
drools: This time the rule says to do some action because both event B AND
event A occurred.
(NOTE: Here, Drools would need to realize that event B has already occurred
and needs to take this into account when it invokes the rules. Thus state
needs to be taken into consideration.)
I have been reading the documentation and have seen the stateless and
stateful sessions in the javadocs. But, I'm not sure if this is what I need
to accomplish the job. I was discouraged when I found this post:
http://lists.jboss.org/pipermail/rules-users/2008-February/004688.html
mentioning that the difference between stateful and stateless was the number
of objects that could be inserted into working memory before calling
fileAllRules().
>From the examples I've seen, Drools seems to be a simple program you call
once and the process is terminated (as opposed to a daemon-like program that
is continuously running). (Please correct me if I'm wrong.) Further, I
understand that Working Memory is where all the facts in Drools are
contained. I am wondering if these "facts" all disappear once an invocation
of Drools has finished. Or, do stateful sessions somehow maintain state
(facts) across Drools invocations?
My best guess is that the Working Memory gets destroyed along with the facts
after an invocation of Drools and that to achieve the state that I want, I
will need to create some sort of infinite loop to encapsulate an invocation
of Drools to keep all the facts in Working Memory. Is that true?
I am more than happy to look all of this up myself but need a push in the
right direction. (Up to this point, I've been looking mainly looking at the
"JBoss Rules User Guide" and searching on the web.)
Thanks for your help and I would be more that happy to clarify any points.
--
View this message in context: http://www.nabble.com/Maintaining-state-across-invocations-tp22068357p220...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 9 months
Tags on Facts (propertyChange Support for example) in Guvnor
by J Michael Dean
Have been helped about declaring attributes of facts for things such
as propertyChangeSupport. However, when I import a DRL file that has
such attributes into Guvnor, there does not appear to be any evidence
that anything happens. The source code returned from Guvnor does not
include the attributes. Does Guvnor know how to handle metadata that
are declared in DRL files? Thanks.
- Mike
15 years, 9 months
Concurrency Issues with JavaDialectConfiguration
by Dave Klein
We are using Drools in a web application and it is working fine with some
space between requests (at least 150 ms) but if the requests are closer
together we start getting the following exception:
Unable to load dialect
'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'
Has anyone else seen this error in this context. I found messages about
this error that had to do with location of .jar files but I don't think
that's our problem since it all works fine most of the time.
Any thoughts or ideas would be greatly appreciated.
Thanks,
Dave
----------
dave-klein.blogspot.com
15 years, 9 months
Using compiled packages
by Dan Seaver
It is my intention to build all rule packages in Guvnor (or some other
process) before deploying the packages to a production environment. I see
that I can use a KnowledgeBuilder with a PKG type resource to create
KnowledgePackages, and then initialize a KnowledgeBase with the
KnowledgePackages.
Though this should do the job for me, is there a way to setup the
KnowledgeBase with the compiled packages without using a KnowledgeBuilder?
My desires are to keep overhead to a minimum and optimize performance during
the initialization step.
In Drools 4, I did this with RuleBase.addPackage using java's standard
serialization techniques. but am uncertain if I can use
KnowledgeBase.addPackages the same way. I assume the binary packages that
are built with Guvnor uses the new drools serialization, so I need to know
how to use that to serialize and deserialize packages as well.
Thanks in advance for any help.
--
View this message in context: http://www.nabble.com/Using-compiled-packages-tp22070145p22070145.html
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 9 months
KnowledgeAgent and Guvnor
by J Michael Dean
RuleAgent could be fed a properties file that included a URL enabling
connection to Guvnor. I cannot find any examples of using a
KnowledgeAgent to connect to Guvnor - can someone point me in the
right direction? Thank you.
- Mike
15 years, 9 months