[rules-users] Problem using KnowledgeAgent
I setup a KnowledgeAgent using the example code in the JavaDoc for KnowledgeAgentFactory to access a compiled package in Guvnor. The package runs fine, but changes to the package are not picked up. I believe this is due to the ChangeSet notification thread being interrupted. But why? Also, I'm getting some messages about failing to read schema document. I think it is caused by the xml for the ChangeSet, but I'm using the example from the JavaDocs. Here's a snippet from the log: [2009:02:48 23:02:905:info] KnowledegAgent has started listening for ChangeSet notifications [2009:02:48 23:02:905:info] KnowledgAgent created, with configuration: monitorChangeSetEvents=true scanResources=true scanDirectories=true [2009:02:48 23:02:905:exception java.lang.RuntimeException: KnowledgeAgent ChangeSet notification thread has been interrupted at org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:465) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.InterruptedException at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(Unknown Source) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source) at org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:463) ... 1 more [2009:02:48 23:02:937:info] KnowledegAgent has stopped listening for ChangeSet notifications (null: 1, 207): schema_reference.4: Failed to read schema document 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. (null: 1, 207): cvc-elt.1: Cannot find the declaration of element 'change-set'. (null: 1, 216): schema_reference.4: Failed to read schema document 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. (null: 1, 343): schema_reference.4: Failed to read schema document 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. [2009:02:48 23:02:390:info] KnowledgAgent applying ChangeSet -- View this message in context: http://www.nabble.com/Problem-using-KnowledgeAgent-tp22073944p22073944.html Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Rule Templates and Guvnor
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 6695 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. ~~ ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Rule Templates and Guvnor
Hi, You can't use templates at the moment. But you can use the copy function in the rule editor. Create a rule that is used as a base, disable it and copy this rule when creating new ones. Toni Rikkola Vikrant Yagnick wrote: 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 6695 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. ~~ ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
RE: [rules-users] Rule Templates and Guvnor
Hi Tony, We were actually looking to use Templates because our clients objected to having code or pseudo-code in an Excel along with the data. Templates, seem an excellent feature where the code bits can be separated from the data bits. One thought I had was to store the templates in the other assets part of Guvnor and the data as well and somehow write something that can pull these out at run-time and create and compile the rules. However, we do loose all the other functionality that Guvnor provides.(Like rule analysis etc). Any idea, if Guvnor is going to support templates in a future release? Cheers, Vikrant -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Toni Rikkola Sent: Wednesday, February 18, 2009 5:02 PM To: Rules Users List Subject: Re: [rules-users] Rule Templates and Guvnor Hi, You can't use templates at the moment. But you can use the copy function in the rule editor. Create a rule that is used as a base, disable it and copy this rule when creating new ones. Toni Rikkola Vikrant Yagnick wrote: 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 6695 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. ~~ ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users 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. ~~ ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] re:KnowledgeAgent and Guvnor
J Michael Dean wrote: 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. You can either build the knowledgebase using urls and/or you can use the applychangeset on the knowledgeagent, you can actually update over time using the applychangeset, so the urls used for an agent are no longer fixed. The polling property is no longer on the agent itself, as it has been moved to a service, which can be accessed via the ResourceFactory. https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/javadocs/stable/drools-api/org/drools/agent/KnowledgeAgentFactory.html https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/javadocs/stable/drools-api/org/drools/ChangeSet.html If the javadocs are not clear, provide an update on how to make them clearer. Mark - Mike Message: 5 Date: Tue, 17 Feb 2009 23:14:45 + From: Mark Proctor mproc...@codehaus.org mailto:mproc...@codehaus.org Subject: Re: [rules-users] KnowledgeAgent and Guvnor To: Rules Users List rules-users@lists.jboss.org mailto:rules-users@lists.jboss.org Message-ID: 499b44e5.7020...@codehaus.org mailto:499b44e5.7020...@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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Problem using KnowledgeAgent
Dan Seaver wrote: I setup a KnowledgeAgent using the example code in the JavaDoc for KnowledgeAgentFactory to access a compiled package in Guvnor. The package runs fine, but changes to the package are not picked up. I believe this is due to the ChangeSet notification thread being interrupted. But why? Hmm that's not good. I have the following unit test: http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/agent/KnowledgeAgentTest.java Could you provide an update for new tests for detecting url changes? When making the test you might find it easier to look at the previous ruleagent tests: http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-core/src/test/java/org/drools/agent/URLScannerTest.java Mark Also, I'm getting some messages about failing to read schema document. I think it is caused by the xml for the ChangeSet, but I'm using the example from the JavaDocs. We haven't provided an XSD yet, so it'll provide schema validation issues, those can be ignored. Here's a snippet from the log: [2009:02:48 23:02:905:info] KnowledegAgent has started listening for ChangeSet notifications [2009:02:48 23:02:905:info] KnowledgAgent created, with configuration: monitorChangeSetEvents=true scanResources=true scanDirectories=true [2009:02:48 23:02:905:exception java.lang.RuntimeException: KnowledgeAgent ChangeSet notification thread has been interrupted at org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:465) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.InterruptedException at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(Unknown Source) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source) at org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:463) ... 1 more [2009:02:48 23:02:937:info] KnowledegAgent has stopped listening for ChangeSet notifications (null: 1, 207): schema_reference.4: Failed to read schema document 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. (null: 1, 207): cvc-elt.1: Cannot find the declaration of element 'change-set'. (null: 1, 216): schema_reference.4: Failed to read schema document 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. (null: 1, 343): schema_reference.4: Failed to read schema document 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. [2009:02:48 23:02:390:info] KnowledgAgent applying ChangeSet ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Rule Templates and Guvnor
Vikrant Yagnick wrote: Hi Tony, We were actually looking to use Templates because our clients objected to having code or pseudo-code in an Excel along with the data. Templates, seem an excellent feature where the code bits can be separated from the data bits. One thought I had was to store the templates in the other assets part of Guvnor and the data as well and somehow write something that can pull these out at run-time and create and compile the rules. However, we do loose all the other functionality that Guvnor provides.(Like rule analysis etc). Any idea, if Guvnor is going to support templates in a future release? We want to but so far have had little end user feedback on templates, so they are still classed as experimental. If it gets more community support and the community helps mature the api and featureset we will look to support this fully. It's just there are lots of different ways the templates could work, not just from excel, but any tabular data source like a DB, so want to make sure we get it right and it's just been a lower priority than getting drools 5.0 out the door. Mark Cheers, Vikrant -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Toni Rikkola Sent: Wednesday, February 18, 2009 5:02 PM To: Rules Users List Subject: Re: [rules-users] Rule Templates and Guvnor Hi, You can't use templates at the moment. But you can use the copy function in the rule editor. Create a rule that is used as a base, disable it and copy this rule when creating new ones. Toni Rikkola Vikrant Yagnick wrote: 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 6695 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. ~~ ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users 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. ~~
Re: [rules-users] Problem using KnowledgeAgent
Mark, I have some more information for you. The exception occurs when I issue: agent.monitorResourceChangeEvents(true|false) If I comment out that code, I don't get the exception, but I don't get changes either. I tried it with both the Guvnor repository and with a deployed package on the file system. I won't have time to create the test you requested until the weekend. Let me know if you still want it. Dan Mark Proctor wrote: Dan Seaver wrote: I setup a KnowledgeAgent using the example code in the JavaDoc for KnowledgeAgentFactory to access a compiled package in Guvnor. The package runs fine, but changes to the package are not picked up. I believe this is due to the ChangeSet notification thread being interrupted. But why? Hmm that's not good. I have the following unit test: http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/agent/KnowledgeAgentTest.java Could you provide an update for new tests for detecting url changes? When making the test you might find it easier to look at the previous ruleagent tests: http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-core/src/test/java/org/drools/agent/URLScannerTest.java Mark Also, I'm getting some messages about failing to read schema document. I think it is caused by the xml for the ChangeSet, but I'm using the example from the JavaDocs. We haven't provided an XSD yet, so it'll provide schema validation issues, those can be ignored. Here's a snippet from the log: [2009:02:48 23:02:905:info] KnowledegAgent has started listening for ChangeSet notifications [2009:02:48 23:02:905:info] KnowledgAgent created, with configuration: monitorChangeSetEvents=true scanResources=true scanDirectories=true [2009:02:48 23:02:905:exception java.lang.RuntimeException: KnowledgeAgent ChangeSet notification thread has been interrupted at org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:465) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.InterruptedException at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(Unknown Source) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source) at org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:463) ... 1 more [2009:02:48 23:02:937:info] KnowledegAgent has stopped listening for ChangeSet notifications (null: 1, 207): schema_reference.4: Failed to read schema document 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. (null: 1, 207): cvc-elt.1: Cannot find the declaration of element 'change-set'. (null: 1, 216): schema_reference.4: Failed to read schema document 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. (null: 1, 343): schema_reference.4: Failed to read schema document 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. [2009:02:48 23:02:390:info] KnowledgAgent applying ChangeSet ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- View this message in context: http://www.nabble.com/Problem-using-KnowledgeAgent-tp22073944p22085204.html Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Re: drools-solver [StartingSolutionInitializer]
With kind regards, Geoffrey De Smet Andrew Waterman schreef: Hi, Thanks for the rules suggestions, using a simple generated id has radically improved my solver times (and my scoring). It surprises me that generated id's radically improve solver times. Could you give an example of what you changed? relativeSelection should radically improve solver times, if tweaked correctly. I'm now looking into using the StartingSolutionInitializer code to feed startingSolutions into the solver. I'm a little confused about the intended functionality in the interface, and wanted to get some feedback. Basically, the simple solver that we had used previously to find our solution space, didn't take into account any of the topographical constraints of our game board. The solutions it offered are not highly specific, in the sense that one doesn't know where all the tokens should be placed. What it does offer are distributions of tokens on the game board. For example: 4 tokens of managed forest per territory. 4 tokens of moderate pasture per territory. 4 tokens of intensive pasture per territory. I'd like to use the startingSolutionInitializer to take a suggested distribution, populate our board with those values, and then pass it back to the solver to solve. For that you don't really need a startingSolutionInitializer, you could just set that solution directly as the starting solution on the solver. A startSolutionInitializer has the advantage that it can reuse the instance of the working memory with the score rules to initialize the starting solution. Is the initializer the right place to do this? Or should I simply view the initializer as a deterministic entry point for ordering and composing an incomplete solution before passing it off to the solver? best wishes, Andrew - Andrew Waterman San Cristóbal de las Casas, Chiapas, Mexico +52 1 967 107 5902 +1 510 342 5693 On Feb 13, 2009, at 8:50 AM, Geoffrey De Smet wrote: With kind regards, Geoffrey De Smet Andrew Waterman schreef: 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 (-504.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)); Doesn't this insert the same logical fact in a loop? So only 1 instance actually remains in the working memory? If you want to have to list.size() affect the score, just do: 3 * list.size() } end Why use collect anyway? when $t1 : Token ($type : type == TokenType.UNDEVELOPED, id1 : id) $t2 : Token ($type : type == TokenType.UNDEVELOPED, id id1, id2 : id) $t3 : Token ($type : type == TokenType.UNDEVELOPED, id id2, id3 : id) // maybe you need things like this: not Token ($type : type == TokenType.UNDEVELOPED, id id3) then insertLogical (new IntConstraintOccurrence (Too much unclaimed territory, ConstraintType.NEGATIVE_SOFT, 3, $t1, $t2, $t3)); 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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org
Re: [rules-users] Re: drools-solver [StartingSolutionInitializer]
Hi Geoffrey, Before, I was simply using a string id, based upon row and column. Now I've implemented a simple generator for an integer based id. This has helped my scoring, as the same two tokens are only matched once, in order, as opposed to being matched twice (or even three times). This makes my scores much easier to understand, and was a great help with debugging my constraints. Speed seems to have gone up some, as the tree doesn't have to double or triple match tokens in workingmemory, but I can't vouch for this as only now are my puzzles being solved properly. I see your point with regards to the startingSolutionInitializer -- I've moved on today to building some simple configurators for the problems I wish to check based on XML (using Jdom). Thanks for all of your input and help through this process; I'm immensely pleased with the end result and will work to pass on feedback as I continue to use the tool. best wishes, Andrew - Andrew Waterman San Cristóbal de las Casas, Chiapas, Mexico +52 1 967 107 5902 +1 510 342 5693 On Feb 18, 2009, at 1:48 PM, Geoffrey De Smet wrote: With kind regards, Geoffrey De Smet Andrew Waterman schreef: Hi, Thanks for the rules suggestions, using a simple generated id has radically improved my solver times (and my scoring). It surprises me that generated id's radically improve solver times. Could you give an example of what you changed? relativeSelection should radically improve solver times, if tweaked correctly. I'm now looking into using the StartingSolutionInitializer code to feed startingSolutions into the solver. I'm a little confused about the intended functionality in the interface, and wanted to get some feedback. Basically, the simple solver that we had used previously to find our solution space, didn't take into account any of the topographical constraints of our game board. The solutions it offered are not highly specific, in the sense that one doesn't know where all the tokens should be placed. What it does offer are distributions of tokens on the game board. For example: 4 tokens of managed forest per territory. 4 tokens of moderate pasture per territory. 4 tokens of intensive pasture per territory. I'd like to use the startingSolutionInitializer to take a suggested distribution, populate our board with those values, and then pass it back to the solver to solve. For that you don't really need a startingSolutionInitializer, you could just set that solution directly as the starting solution on the solver. A startSolutionInitializer has the advantage that it can reuse the instance of the working memory with the score rules to initialize the starting solution. Is the initializer the right place to do this? Or should I simply view the initializer as a deterministic entry point for ordering and composing an incomplete solution before passing it off to the solver? best wishes, Andrew - Andrew Waterman San Cristóbal de las Casas, Chiapas, Mexico +52 1 967 107 5902 +1 510 342 5693 On Feb 13, 2009, at 8:50 AM, Geoffrey De Smet wrote: With kind regards, Geoffrey De Smet Andrew Waterman schreef: 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 (-504.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)); Doesn't this insert the same logical fact in a loop? So only 1 instance actually remains in the working memory? If you want to have to list.size() affect the score, just do: 3 * list.size() } end Why use collect anyway? when $t1 : Token ($type : type == TokenType.UNDEVELOPED, id1 : id) $t2 : Token ($type : type == TokenType.UNDEVELOPED, id id1, id2 : id) $t3 : Token ($type : type == TokenType.UNDEVELOPED, id id2, id3 : id) // maybe you need things like this: not Token ($type : type == TokenType.UNDEVELOPED, id id3) then insertLogical (new IntConstraintOccurrence (Too much unclaimed territory, ConstraintType.NEGATIVE_SOFT, 3, $t1, $t2, $t3)); 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
[rules-users] Annotation-Defined POJO Rules?
Found this page here which describes how to write POJO rules: http://docs.codehaus.org/display/DROOLS/Drools+Spring+Tutorial Neat! But I don't see any mention of this in the current versions of Drools :-( Was this approach abandoned? ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Problem using KnowledgeAgent
So from the filesystem it won't pick up changes? (does it throw the same exception). On Thu, Feb 19, 2009 at 5:34 AM, Dan Seaver dan.sea...@ge.com wrote: Mark, I have some more information for you. The exception occurs when I issue: agent.monitorResourceChangeEvents(true|false) If I comment out that code, I don't get the exception, but I don't get changes either. I tried it with both the Guvnor repository and with a deployed package on the file system. I won't have time to create the test you requested until the weekend. Let me know if you still want it. Dan Mark Proctor wrote: Dan Seaver wrote: I setup a KnowledgeAgent using the example code in the JavaDoc for KnowledgeAgentFactory to access a compiled package in Guvnor. The package runs fine, but changes to the package are not picked up. I believe this is due to the ChangeSet notification thread being interrupted. But why? Hmm that's not good. I have the following unit test: http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/agent/KnowledgeAgentTest.java Could you provide an update for new tests for detecting url changes? When making the test you might find it easier to look at the previous ruleagent tests: http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-core/src/test/java/org/drools/agent/URLScannerTest.java Mark Also, I'm getting some messages about failing to read schema document. I think it is caused by the xml for the ChangeSet, but I'm using the example from the JavaDocs. We haven't provided an XSD yet, so it'll provide schema validation issues, those can be ignored. Here's a snippet from the log: [2009:02:48 23:02:905:info] KnowledegAgent has started listening for ChangeSet notifications [2009:02:48 23:02:905:info] KnowledgAgent created, with configuration: monitorChangeSetEvents=true scanResources=true scanDirectories=true [2009:02:48 23:02:905:exception java.lang.RuntimeException: KnowledgeAgent ChangeSet notification thread has been interrupted at org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:465) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.InterruptedException at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(Unknown Source) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source) at org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:463) ... 1 more [2009:02:48 23:02:937:info] KnowledegAgent has stopped listening for ChangeSet notifications (null: 1, 207): schema_reference.4: Failed to read schema document 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. (null: 1, 207): cvc-elt.1: Cannot find the declaration of element 'change-set'. (null: 1, 216): schema_reference.4: Failed to read schema document 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. (null: 1, 343): schema_reference.4: Failed to read schema document 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. [2009:02:48 23:02:390:info] KnowledgAgent applying ChangeSet ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- View this message in context: http://www.nabble.com/Problem-using-KnowledgeAgent-tp22073944p22085204.html Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Michael D Neale home: www.michaelneale.net blog: michaelneale.blogspot.com ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Problem using KnowledgeAgent
Michael Neale wrote: So from the filesystem it won't pick up changes? (does it throw the same exception). I believe the exception shown is a red herring, as the looping thread of the scanner is interrupted as part of the stop() process and we log that exception, incase the exception was caused by something else. Mark On Thu, Feb 19, 2009 at 5:34 AM, Dan Seaver dan.sea...@ge.com wrote: Mark, I have some more information for you. The exception occurs when I issue: agent.monitorResourceChangeEvents(true|false) If I comment out that code, I don't get the exception, but I don't get changes either. I tried it with both the Guvnor repository and with a deployed package on the file system. I won't have time to create the test you requested until the weekend. Let me know if you still want it. Dan Mark Proctor wrote: Dan Seaver wrote: I setup a KnowledgeAgent using the example code in the JavaDoc for KnowledgeAgentFactory to access a compiled package in Guvnor. The package runs fine, but changes to the package are not picked up. I believe this is due to the ChangeSet notification thread being interrupted. But why? Hmm that's not good. I have the following unit test: http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/agent/KnowledgeAgentTest.java Could you provide an update for new tests for detecting url changes? When making the test you might find it easier to look at the previous ruleagent tests: http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-core/src/test/java/org/drools/agent/URLScannerTest.java Mark Also, I'm getting some messages about failing to read schema document. I think it is caused by the xml for the ChangeSet, but I'm using the example from the JavaDocs. We haven't provided an XSD yet, so it'll provide schema validation issues, those can be ignored. Here's a snippet from the log: [2009:02:48 23:02:905:info] KnowledegAgent has started listening for ChangeSet notifications [2009:02:48 23:02:905:info] KnowledgAgent created, with configuration: monitorChangeSetEvents=true scanResources=true scanDirectories=true [2009:02:48 23:02:905:exception java.lang.RuntimeException: KnowledgeAgent ChangeSet notification thread has been interrupted at org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:465) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.InterruptedException at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(Unknown Source) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source) at org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:463) ... 1 more [2009:02:48 23:02:937:info] KnowledegAgent has stopped listening for ChangeSet notifications (null: 1, 207): schema_reference.4: Failed to read schema document 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. (null: 1, 207): cvc-elt.1: Cannot find the declaration of element 'change-set'. (null: 1, 216): schema_reference.4: Failed to read schema document 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. (null: 1, 343): schema_reference.4: Failed to read schema document 'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not xsd:schema. [2009:02:48 23:02:390:info] KnowledgAgent applying ChangeSet ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- View this message in context: http://www.nabble.com/Problem-using-KnowledgeAgent-tp22073944p22085204.html Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] drools 4.0.7 with jdk 1.4
Does anyone know whether Drools 4.0.7 support JDK 1.4 ? Also, can we use drools 4.0.7 BRMS tool with WAS 6.0? Thanks Ram -- View this message in context: http://www.nabble.com/drools-4.0.7-with-jdk-1.4-tp22053007p22053007.html Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] drools 4.0.7 with jdk 1.4
NRAM wrote: Does anyone know whether Drools 4.0.7 support JDK 1.4 ? Also, can we use drools 4.0.7 BRMS tool with WAS 6.0 (I mean will it work with jdk 1.4)? Thanks Ram It's amazing what google will turn up: http://lists.jboss.org/pipermail/rules-dev/2007-November/000611.html the BRMS in 4.0.x is JDK1.5 and above, the engine, compiler, decision tables, jsr94 etc are jdk1.4 in Drools 4.0.x. Websphere 6.1 is documented as working, with provided troubleshooting: http://www.jboss.org/community/docs/DOC-12671 I believe Websphere 6.0 id JDK1.4+ and thus won't work with BRMS which as stated above is jdk1.5+ ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users