[BAD
by Wolfgang Laun
rule init
salience 9999
when
then
insert( Integer.valueOf( 10 ) );
insert( Integer.valueOf( 50 ) );
insert( Integer.valueOf( 60 ) );
insert( Integer.valueOf( 40 ) );
insert( Integer.valueOf( 20 ) );
end
rule "Rule 04"
## dialect "mvel"
when
$number : Integer( $i: intValue )
not Integer(intValue < $i)
then
System.out.println("Number found with value: " + $number.intValue());
retract($number);
end
On 17/01/2013, Wolfgang Laun <wolfgang.laun(a)gmail.com> wrote:
> This BAD bug was introduced on the way from 5.4.0 to 5.5.0 (and seems
> to have sneaked into 6.0.0 as well).
>
> Only 5.4.0 and predecessors work as expected.
>
> Damage control? How far can 5.5.0 be trusted?
>
>
> On 17/01/2013, John Smith <ffirstt.llastt(a)gmail.com> wrote:
>> I am new to Drools and am trying to get the sample program to work. This
>> sample is given in the drools documentation
>> http://docs.jboss.org/drools/release/5.5.0.Final/drools-expert-docs/html_....
>> This drool rule is expected to sort integers. I just changed the numbers
>> from what are given in the sample and they do not get sorted as expected.
>> Tried using drools version 5.5.0, 5.5.1 and the master 6.0.0, but got the
>> same wrong results.
>>
>> Following is the main code:
>> package com.sample;
>>
>> public class Example2 {
>> public static void main(String[] args) throws Exception {
>> Number[] numbers = new Number[] { wrap(5), wrap(6), wrap(4),
>> wrap(1), wrap(2) };
>> new RuleRunner().runRules(new String[] { "Example3.drl" },
>> numbers);
>> }
>>
>> private static Integer wrap(int i) {
>> return new Integer(i);
>> }
>> }
>>
>> The RuleRunner class is the same as given in the example and I do not
>> think
>> I should give that here, since it will clutter the question. It simply
>> creates the KnowledgeBase, stateful session, inserts the facts as given
>> in
>> the 'numbers' array above and then calls fireAllRules method on the
>> session.
>>
>> The rule file (Example3.drl) is:
>>
>>
>> rule "Rule 04"
>> dialect "mvel"
>> when
>> $number : Number()
>> not Number(intValue < $number.intValue)
>> then
>> System.out.println("Number found with value: " +
>> $number.intValue());
>> retract($number);
>> end
>>
>>
>> The output I get is as follows:
>> Loading file: Example3.drl
>> Inserting fact: 5
>> Inserting fact: 6
>> Inserting fact: 4
>> Inserting fact: 1
>> Inserting fact: 2
>> Number found with value: 1
>> Number found with value: 4
>> Number found with value: 2
>> Number found with value: 5
>> Number found with value: 6
>>
>> Not the correct expected ascending sorted order.
>>
>> What might I be doing wrong? I cannot imagine that the drools rule engine
>> would be broken at this basic level.
>>
>>
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/Drools-Expert-does-not-sort-integers-co...
>> 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
>>
>
11 years, 3 months
Need explanation for activation-group attributes.
by suddeb
Hi,
Suppose I have the below rules:
*Rule "A"
salience 100
When
then
end
Rule "B"
activation-group "AC1"
salience 100
when
then
end
Rule "C"
activation-group "AC2"
salience 100
when
then
end
Rule "D"
activation-group "AC1"
activation-group "AC2"
salience 90
when
then
end*//
Now the scenarios are:
*If B, then no D*, which is happening correctly
*If C, then no D*, which is happening correctly
*If A, then D*, /This is what is not happening./
Could you please let me know how can I achieve this?
If more information required, please let me know. Thanks.
Regards,
Sudipta Deb.
--
View this message in context: http://drools.46999.n3.nabble.com/Need-explanation-for-activation-group-a...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
rule validates in guvnor but errors when running
by kurrent93
Hi
I'm trying to understand what is wrong with this rule. It validates in
guvnor, but when running it throws an error.
I am trying to write a rule that will fire if there have been less than ten
trades in ten minutes.
This is the rule:
1. | rule "Trade Count"
2. | dialect "mvel"
3. | when
4. | Number( trades : intValue < 10 )
5. | from accumulate(
6. | e: TradeOrder( )
7. | over window:size(10m),
8. | count(e) )
9. | then
10. | TradeOrder silverTrade = new TradeOrder();
11. | silverTrade.setMt4username( "4002642" );
12. | silverTrade.setOperation( "OP_BUY" );
13. | silverTrade.setStatus( OrderStatus.OPENING );
14. | silverTrade.setSymbol( "SILVER" );
15. | silverTrade.setVolume( 1 );
16. | silverTrade.setOrderLots( 2 );
17. | insert( silverTrade );
18. |
19. |
20. | modifiedOrderList.add(silverTrade);
21. | end
What I assume to be the relevant portion of the stack trace is here:
Caused by: java.lang.NoSuchMethodError:
org.mvel2.compiler.CompiledExpression.getParserConfiguration()Lorg/mvel2/ParserConfiguration;
at
org.drools.rule.constraint.MvelConstraint.createMvelConditionEvaluator(MvelConstraint.java:207)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
at
org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:190)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
at
org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:157)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
at
org.drools.reteoo.AccumulateNode.evaluateResultConstraints(AccumulateNode.java:651)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
at
org.drools.reteoo.ReteooWorkingMemory$EvaluateResultConstraints.execute(ReteooWorkingMemory.java:590)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
at
org.drools.common.PropagationContextImpl.evaluateActionQueue(PropagationContextImpl.java:350)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:355)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
[drools-core-5.5.0.Final.jar:5.5.0.Final]
at
org.switchyard.component.rules.exchange.drools.DroolsRulesExchangeHandler.handleMessage(DroolsRulesExchangeHandler.java:280)
[switchyard-component-rules-0.6.0-SNAPSHOT.jar:0.6.0-SNAPSHOT]
at
org.switchyard.bus.camel.ProviderProcessor.process(CamelExchangeBus.java:216)
at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
[camel-core-2.10.0.jar:2.10.0]
... 153 more
--
View this message in context: http://drools.46999.n3.nabble.com/rule-validates-in-guvnor-but-errors-whe...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
Change Scanner does not start
by Antonio Anderson Souza
Dear All,
I have an application that use Guvnor 5.4.0 final as the rules repository
and a DroolsServer 5.4.0 final (with Spring Camel) to provide rule engine
via a Rest Webservices, all of those apps Running in a JBossAS 7.1.
All of the service are working perfectly, except the
resource-change-scanner that is configured in the knowledge-services.xml
[1] as it's described in the documentation.
When Drools-Server are deployed the Change Scanner does not start (I'm
monitoring the change scanner via Wireshark analyzing the communication
between DroolServer and Guvnor), I've created an small JSP file [2] that
invoke the ChangeScanner start method, when i run the JSP the Change
Scanner start to work (i can see the http requests from Drools Server do
Guvnor to see if the knowledge base had changed), but after Change Scanner
started working the rules are not triggered anymore.
So without Change Scanner I've all of the knowledge service running
properly, but the App is unable to detect rules changes, when I explicitly
(via JSP) start the Change Scanner all of the knowledge service stopped
working.
Change Scanner starts automatically?
Does anybody has some idea to help me?
[1] ------------------------------------------------------------------------
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:drools="http://drools.org/schema/drools-spring"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://drools.org/schema/drools-spring
http://drools.org/schema/drools-spring-1.3.0.xsd">
<drools:grid-node id="node1"/>
<drools:resource-change-scanner id="scanner" interval="10" />
<drools:kbase id="kbase1" node="node1" />
<drools:kagent id="kagent1" kbase="kbase1">
<drools:resources>
<drools:resource type="CHANGE_SET" source="classpath:ChangeSet.xml" />
</drools:resources>
</drools:kagent>
<drools:ksession id="ksession1" type="stateless" kbase="kbase1"
node="node1"/>
</beans>
[2] ------------------------------------------------------------------------
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%
org.drools.io.ResourceChangeScannerConfiguration sconf =
org.drools.io.ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
sconf.setProperty("drools.resource.scanner.interval", "5");
org.drools.io.ResourceFactory.getResourceChangeScannerService().configure(sconf);
org.drools.io.ResourceFactory.getResourceChangeScannerService().start();
org.drools.io.ResourceFactory.getResourceChangeNotifierService().start();
%>
Best Regards,
Antonio Anderson Souza
<http://174.129.217.139:8080/makecallclient/callme?p=YXNvdXphQHZvaWNlLmJyY...>
Blog <http://www.antonioams.com> - Twitter <http://twitter.com/antonioams>-
LinkedIn <http://br.linkedin.com/in/antonioams> -
Facebook<http://www.facebook.com/antonioams>
11 years, 3 months
How to start with Drools Fusion as a Java enterprise newbie
by Thomas Söhngen
Hi,
I am currently evaluating Drools for our needs, from the features it
seems to be a perfect fit. I am a Java developer, but unfortunately I
have no background in enterprise application servers and I am currently
stuck trying to setup a testing environment. A short summary of our
current setup and how we want to use Drools:
* We are using Storm <https://github.com/nathanmarz/storm> to
accumulate a large number of messages from around the web
* From these we create streams of message metadata (like sentiment)
for different topics (like stocks)
* We have additional streams like stock-tickers
* We have a knowledge-base of additional facts about companies (like
market cap.) in MySQL
* We want users to be able to define alerts triggered by rules based
on these streams and facts
Storm is perfect for the data pre-processing and aggregation, Drools
would fit in to allow outsiders to define rules and evaluate them on the
streams in realtime. My idea is, to run Drools Fusion as a stand-alone
application on a dedicated server or cluster of servers. Drools Guvnor
would be used as an interface for the rules. The rules would trigger new
events, which would be sent to a subscription channel (like Redis Pub/Sub).
As mentioned above, I have no experience in setting up and running Java
application servers. The Drools documentation seems to be very
elaborate, but assume that you know how to start such a service from
scratch, which I don't. I know Java, but not at an enterprise level, so
all the Beans, wars, etc. are new to me. I setup a JBoss AS, which was a
pretty easy thing to do, but I am clueless about how to really "run"
Drools on it and what to do next.
So what would be the next steps to get a server, where I can send
messages to? Are there any tutorials or guidelines which describe how to
built such a thing from the very beginning? Any help or suggestion would
be very appreciated!
Regards & thanks in advance,
Thomas Söhngen
11 years, 3 months
XOR Rules
by Bojan Janisch
Hello everybody,
is there a way to XOR two rules? So if one condition is passed,
that not a specific other rule fires, even if that condition
also passed.
Thanks in advance.
Bojan
11 years, 3 months
Still stuck on simple test case
by Michiel Vermandel
Hi,
I'm still (or again) stuck on an easy test case.
A few days ago I first mentioned I had I very easy unit test that easily could be solved on sight but which was not solved optimal by planner.
Geoffrey pointed out that I needed to adjust the value of entityTabuSize in my localSearch acceptor configuration.
I did so (reducing from 7 to 3) and it worked, but now, having fiddled a bit on one of my rules I'm stuck again on the same issue.
I created a custom solver phase to force a specific solution and when adding this phase into my configuration I get a zero-score solution, namely the solution I forced.
So it does not seem to be an issue in my rules.
As suggested before by Geoffrey, I have put the logging level to debug and I get a lot of output like this (see beneath), but I don't really know how this can help me in solving the issue:
(I left out a lot of lines, I hope I left in the important ones)
INFO : [2013-01-16 09:34:29,847] Solving started: time spend (90), score (null), new best score (null), random seed (0).
DEBUG: [2013-01-16 09:34:30,113] Step index (0), time spend (357), score (-80hard/0soft), initialized planning entity (Inspection of PG_Leuven.I#0 2137587059).
DEBUG: [2013-01-16 09:34:30,248] Step index (1), time spend (492), score (-81hard/0soft), initialized planning entity (Inspection of PG_Haacht.I#0 1475783831).
DEBUG: [2013-01-16 09:34:30,268] Step index (2), time spend (512), score (-81hard/0soft), initialized planning entity (Inspection of PG_Leuven.I#2 2137587061).
DEBUG: [2013-01-16 09:34:30,295] Step index (3), time spend (539), score (-81hard/0soft), initialized planning entity (Inspection of Rotselaar.I#0 -105164233).
DEBUG: [2013-01-16 09:34:30,405] Step index (4), time spend (649), score (-161hard/0soft), initialized planning entity (Inspection of Rotselaar.I#1 -105164232).
DEBUG: [2013-01-16 09:34:30,490] Step index (5), time spend (734), score (-242hard/0soft), initialized planning entity (Inspection of PG_Haacht.I#1 1475783832).
DEBUG: [2013-01-16 09:34:30,572] Step index (6), time spend (816), score (-392hard/0soft), initialized planning entity (Inspection of PG_Leuven.I#1 2137587060).
INFO : [2013-01-16 09:34:30,572] Phase constructionHeuristic ended: step total (7), time spend (816), best score (-392hard/0soft).
DEBUG: [2013-01-16 09:34:31,499] Step index (0), time spend (1743), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/1000) for picked step (Inspection of PG_Leuven.I#1 2137587060 => (P8) ).
DEBUG: [2013-01-16 09:34:32,037] Step index (1), time spend (2281), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/1215) for picked step (Inspection of PG_Haacht.I#0 1475783831 => TL).
DEBUG: [2013-01-16 09:34:32,635] Step index (2), time spend (2879), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/1587) for picked step (Inspection of Rotselaar.I#1 -105164232 => TL).
DEBUG: [2013-01-16 09:34:32,914] Step index (3), time spend (3158), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/2118) for picked step (Inspection of PG_Haacht.I#1 1475783832 => TL).
DEBUG: [2013-01-16 09:34:33,128] Step index (4), time spend (3372), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/2039) for picked step (Inspection of PG_Leuven.I#1 2137587060 => (P2) ).
...
DEBUG: [2013-01-16 09:34:41,219] Step index (68), time spend (11463), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/1995) for picked step (Inspection of PG_Haacht.I#0 1475783831 => TL).
DEBUG: [2013-01-16 09:34:41,340] Step index (69), time spend (11584), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/2070) for picked step (Inspection of PG_Leuven.I#1 2137587060 => IV).
DEBUG: [2013-01-16 09:34:41,460] Step index (70), time spend (11704), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/2034) for picked step (Inspection of PG_Leuven.I#0 2137587059 => TL).
DEBUG: [2013-01-16 09:34:41,575] Step index (71), time spend (11819), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/1978) for picked step (Inspection of PG_Haacht.I#1 1475783832 => (P4) ).
DEBUG: [2013-01-16 09:34:41,693] Step index (72), time spend (11937), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/2045) for picked step (Inspection of Rotselaar.I#0 -105164233 => TL).
DEBUG: [2013-01-16 09:34:41,813] Step index (73), time spend (12057), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/2052) for picked step (Inspection of Rotselaar.I#1 -105164232 <=> Inspection of PG_Leuven.I#1 2137587060).
DEBUG: [2013-01-16 09:34:41,970] Step index (74), time spend (12214), score (-312hard/0soft), new best score (-312hard/0soft), accepted/selected move count (1000/2673) for picked step (Inspection of Rotselaar.I#1 -105164232 => Jesse).
DEBUG: [2013-01-16 09:34:42,089] Step index (75), time spend (12333), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (1000/2039) for picked step (Inspection of PG_Haacht.I#1 1475783832 => IV).
DEBUG: [2013-01-16 09:34:42,223] Step index (76), time spend (12467), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (1000/1997) for picked step (Inspection of PG_Leuven.I#2 2137587061 => TL).
DEBUG: [2013-01-16 09:34:42,346] Step index (77), time spend (12590), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (1000/2073) for picked step (Inspection of PG_Haacht.I#0 1475783831 => IV).
DEBUG: [2013-01-16 09:34:42,484] Step index (78), time spend (12728), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (1000/2093) for picked step (Inspection of PG_Leuven.I#1 2137587060 => IV).
DEBUG: [2013-01-16 09:34:42,607] Step index (79), time spend (12851), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (1000/2049) for picked step (Inspection of PG_Haacht.I#1 1475783832 => TL).
DEBUG: [2013-01-16 09:34:42,720] Step index (80), time spend (12964), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (1000/1977) for picked step (Inspection of PG_Leuven.I#0 2137587059 => IV).
DEBUG: [2013-01-16 09:34:42,836] Step index (81), time spend (13080), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (1000/1991) for picked step (Inspection of PG_Haacht.I#0 1475783831 => TL).
DEBUG: [2013-01-16 09:34:42,959] Step index (82), time spend (13203), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (1000/2012) for picked step (Inspection of Rotselaar.I#0 -105164233 => (P3) ).
DEBUG: [2013-01-16 09:34:43,078] Step index (83), time spend (13322), score (-162hard/0soft), new best score (-162hard/0soft), accepted/selected move count (1000/2028) for picked step (Inspection of Rotselaar.I#1 -105164232 => (P3) ).
DEBUG: [2013-01-16 09:34:43,195] Step index (84), time spend (13439), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2013) for picked step (Inspection of PG_Leuven.I#1 2137587060 => TL).
DEBUG: [2013-01-16 09:34:43,313] Step index (85), time spend (13557), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2086) for picked step (Inspection of PG_Leuven.I#0 2137587059 => TL).
DEBUG: [2013-01-16 09:34:43,424] Step index (86), time spend (13668), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2011) for picked step (Inspection of PG_Haacht.I#1 1475783832 => IV).
DEBUG: [2013-01-16 09:34:43,540] Step index (87), time spend (13784), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2017) for picked step (Inspection of PG_Haacht.I#0 1475783831 => IV).
DEBUG: [2013-01-16 09:34:43,663] Step index (88), time spend (13907), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2090) for picked step (Inspection of Rotselaar.I#1 -105164232 => TL).
...
DEBUG: [2013-01-16 09:36:04,828] Step index (468), time spend (58711), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2071) for picked step (Inspection of PG_Leuven.I#1 2137587060 => IV).
DEBUG: [2013-01-16 09:36:04,949] Step index (469), time spend (58832), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2134) for picked step (Inspection of PG_Leuven.I#0 2137587059 => TL).
DEBUG: [2013-01-16 09:36:05,066] Step index (470), time spend (58949), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2073) for picked step (Inspection of Rotselaar.I#0 -105164233 => TL).
DEBUG: [2013-01-16 09:36:05,183] Step index (471), time spend (59066), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2067) for picked step (Inspection of Rotselaar.I#1 -105164232 => TL).
DEBUG: [2013-01-16 09:36:05,296] Step index (472), time spend (59179), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2034) for picked step (Inspection of PG_Haacht.I#0 1475783831 => IV).
DEBUG: [2013-01-16 09:36:05,409] Step index (473), time spend (59292), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2025) for picked step (Inspection of PG_Leuven.I#2 2137587061 => IV).
DEBUG: [2013-01-16 09:36:05,519] Step index (474), time spend (59402), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/1972) for picked step (Inspection of PG_Haacht.I#1 1475783832 => IV).
DEBUG: [2013-01-16 09:36:05,634] Step index (475), time spend (59517), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2028) for picked step (Inspection of PG_Leuven.I#1 2137587060 => TL).
DEBUG: [2013-01-16 09:36:05,749] Step index (476), time spend (59632), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2078) for picked step (Inspection of Rotselaar.I#0 -105164233 => IV).
DEBUG: [2013-01-16 09:36:05,863] Step index (477), time spend (59746), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2042) for picked step (Inspection of Rotselaar.I#1 -105164232 => IV).
DEBUG: [2013-01-16 09:36:05,980] Step index (478), time spend (59863), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2072) for picked step (Inspection of PG_Haacht.I#1 1475783832 => TL).
DEBUG: [2013-01-16 09:36:06,095] Step index (479), time spend (59978), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2037) for picked step (Inspection of PG_Leuven.I#1 2137587060 => IV).
DEBUG: [2013-01-16 09:36:06,118] Step index (480), time spend (60001), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (171/360) for picked step (Inspection of PG_Leuven.I#0 2137587059 => IV).
INFO : [2013-01-16 09:36:06,118] Phase localSearch ended: step total (481), time spend (60001), best score (-162hard/0soft).
INFO : [2013-01-16 09:36:06,118] Solving ended: time spend (60001), best score (-162hard/0soft), average calculate count per second (32639).
isEveryProblemFactChangeProcessed: true
isTerminateEarly: false
My configuration:
<localSearch>
<termination>
<terminationCompositionStyle>OR</terminationCompositionStyle>
<maximumSecondsSpend>3600</maximumSecondsSpend>
<scoreAttained>0hard/0soft</scoreAttained>
</termination>
<unionMoveSelector>
<changeMoveSelector>
<valueSelector>
<planningVariableName>period</planningVariableName>
</valueSelector>
</changeMoveSelector>
<changeMoveSelector>
<valueSelector>
<planningVariableName>inspector</planningVariableName>
</valueSelector>
</changeMoveSelector>
<changeMoveSelector>
<valueSelector>
<planningVariableName>type</planningVariableName>
</valueSelector>
</changeMoveSelector>
<swapMoveSelector>
</swapMoveSelector>
</unionMoveSelector>
<acceptor>
<planningEntityTabuSize>3</planningEntityTabuSize>
</acceptor>
<forager>
<minimalAcceptedSelection>1000</minimalAcceptedSelection>
</forager>
</localSearch>
I also tried with a different localSearch configuration:
<localSearch>
<termination>
<terminationCompositionStyle>OR</terminationCompositionStyle>
<maximumSecondsSpend>3600</maximumSecondsSpend>
<scoreAttained>0hard/0soft</scoreAttained>
</termination>
<unionMoveSelector>
<changeMoveSelector>
<valueSelector>
<planningVariableName>period</planningVariableName>
</valueSelector>
</changeMoveSelector>
<changeMoveSelector>
<valueSelector>
<planningVariableName>inspector</planningVariableName>
</valueSelector>
</changeMoveSelector>
<changeMoveSelector>
<valueSelector>
<planningVariableName>type</planningVariableName>
</valueSelector>
</changeMoveSelector>
<swapMoveSelector>
</swapMoveSelector>
</unionMoveSelector>
<acceptor>
<simulatedAnnealingStartingTemperature>2hard/100soft</simulatedAnnealingStartingTemperature>
<planningEntityTabuSize>3</planningEntityTabuSize>
</acceptor>
<forager>
<minimalAcceptedSelection>4</minimalAcceptedSelection>
</forager>
</localSearch>
Result:
INFO : [2013-01-16 09:12:43,653] Solving started: time spend (87), score (null), new best score (null), random seed (0).
DEBUG: [2013-01-16 09:12:43,917] Step index (0), time spend (352), score (-80hard/0soft), initialized planning entity (Inspection of B747-AX1.I#0 2137587059).
DEBUG: [2013-01-16 09:12:44,039] Step index (1), time spend (474), score (-81hard/0soft), initialized planning entity (Inspection of B737-DX7.I#0 1475783831).
DEBUG: [2013-01-16 09:12:44,060] Step index (2), time spend (495), score (-81hard/0soft), initialized planning entity (Inspection of B747-AX1.I#2 2137587061).
DEBUG: [2013-01-16 09:12:44,088] Step index (3), time spend (523), score (-81hard/0soft), initialized planning entity (Inspection of B737-DC3.I#0 -105164233).
DEBUG: [2013-01-16 09:12:44,176] Step index (4), time spend (611), score (-161hard/0soft), initialized planning entity (Inspection of B737-DC3.I#1 -105164232).
DEBUG: [2013-01-16 09:12:44,270] Step index (5), time spend (705), score (-242hard/0soft), initialized planning entity (Inspection of B737-DX7.I#1 1475783832).
DEBUG: [2013-01-16 09:12:44,380] Step index (6), time spend (815), score (-392hard/0soft), initialized planning entity (Inspection of B747-AX1.I#1 2137587060).
INFO : [2013-01-16 09:12:44,380] Phase constructionHeuristic ended: step total (7), time spend (815), best score (-392hard/0soft).
DEBUG: [2013-01-16 09:12:44,420] Step index (0), time spend (855), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/19) for picked step (Inspection of B747-AX1.I#2 2137587061 => TL).
DEBUG: [2013-01-16 09:12:44,444] Step index (1), time spend (879), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/27) for picked step (Inspection of B737-DC3.I#0 -105164233 => TL).
DEBUG: [2013-01-16 09:12:44,465] Step index (2), time spend (900), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/23) for picked step (Inspection of B747-AX1.I#0 2137587059 => TL).
DEBUG: [2013-01-16 09:12:44,488] Step index (3), time spend (923), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/23) for picked step (Inspection of B737-DC3.I#1 -105164232 => TL).
DEBUG: [2013-01-16 09:12:44,529] Step index (4), time spend (964), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/21) for picked step (Inspection of B747-AX1.I#1 2137587060 => TL).
...
DEBUG: [2013-01-16 09:12:44,776] Step index (12), time spend (1211), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/13) for picked step (Inspection of B737-DX7.I#0 1475783831 => IV).
DEBUG: [2013-01-16 09:12:44,814] Step index (13), time spend (1249), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/45) for picked step (Inspection of B737-DX7.I#1 1475783832 => (P4) ).
DEBUG: [2013-01-16 09:12:44,849] Step index (14), time spend (1284), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/46) for picked step (Inspection of B747-AX1.I#2 2137587061 => IV).
DEBUG: [2013-01-16 09:12:44,880] Step index (15), time spend (1315), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/39) for picked step (Inspection of B747-AX1.I#0 2137587059 => TL).
...
DEBUG: [2013-01-16 09:12:47,043] Step index (122), time spend (3478), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/40) for picked step (Inspection of B737-DX7.I#0 1475783831 => IV).
DEBUG: [2013-01-16 09:12:47,046] Step index (123), time spend (3481), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/20) for picked step (Inspection of B747-AX1.I#0 2137587059 => TL).
DEBUG: [2013-01-16 09:12:47,049] Step index (124), time spend (3484), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/16) for picked step (Inspection of B737-DC3.I#0 -105164233 => TL).
DEBUG: [2013-01-16 09:12:47,056] Step index (125), time spend (3491), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/46) for picked step (Inspection of B737-DC3.I#1 -105164232 <=> Inspection of B747-AX1.I#1 2137587060).
DEBUG: [2013-01-16 09:12:47,062] Step index (126), time spend (3497), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/44) for picked step (Inspection of B737-DX7.I#0 1475783831 => TL).
DEBUG: [2013-01-16 09:12:47,067] Step index (127), time spend (3502), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/26) for picked step (Inspection of B747-AX1.I#2 2137587061 => TL).
DEBUG: [2013-01-16 09:12:47,072] Step index (128), time spend (3507), score (-312hard/0soft), new best score (-312hard/0soft), accepted/selected move count (4/27) for picked step (Inspection of B737-DC3.I#1 -105164232 => Jesse).
DEBUG: [2013-01-16 09:12:47,078] Step index (129), time spend (3513), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/37) for picked step (Inspection of B747-AX1.I#0 2137587059 => IV).
DEBUG: [2013-01-16 09:12:47,080] Step index (130), time spend (3515), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/16) for picked step (Inspection of B737-DX7.I#0 1475783831 => IV).
...
DEBUG: [2013-01-16 09:12:47,131] Step index (137), time spend (3566), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/28) for picked step (Inspection of B747-AX1.I#1 2137587060 => IV).
DEBUG: [2013-01-16 09:12:47,135] Step index (138), time spend (3570), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/16) for picked step (Inspection of B747-AX1.I#2 2137587061 <=> Inspection of B737-DC3.I#1 -105164232).
DEBUG: [2013-01-16 09:12:47,142] Step index (139), time spend (3577), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/69) for picked step (Inspection of B737-DX7.I#0 1475783831 => IV).
DEBUG: [2013-01-16 09:12:47,148] Step index (140), time spend (3583), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/39) for picked step (Inspection of B737-DC3.I#0 -105164233 => TL).
DEBUG: [2013-01-16 09:12:47,151] Step index (141), time spend (3586), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/22) for picked step (Inspection of B747-AX1.I#0 2137587059 => IV).
DEBUG: [2013-01-16 09:12:47,153] Step index (142), time spend (3588), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/9) for picked step (Inspection of B747-AX1.I#2 2137587061 <=> Inspection of B737-DC3.I#1 -105164232).
DEBUG: [2013-01-16 09:12:47,160] Step index (143), time spend (3595), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/51) for picked step (Inspection of B737-DX7.I#1 1475783832 => IV).
DEBUG: [2013-01-16 09:12:47,167] Step index (144), time spend (3602), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/50) for picked step (Inspection of B747-AX1.I#1 2137587060 => TL).
DEBUG: [2013-01-16 09:12:47,172] Step index (145), time spend (3607), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/37) for picked step (Inspection of B737-DC3.I#0 -105164233 => IV).
...
DEBUG: [2013-01-16 09:12:47,824] Step index (259), time spend (4259), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/27) for picked step (Inspection of B737-DC3.I#0 -105164233 => IV).
DEBUG: [2013-01-16 09:12:47,827] Step index (260), time spend (4262), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/30) for picked step (Inspection of B737-DC3.I#1 -105164232 <=> Inspection of B747-AX1.I#2 2137587061).
DEBUG: [2013-01-16 09:12:47,835] Step index (261), time spend (4270), score (-242hard/0soft), new best score (-242hard/0soft), accepted/selected move count (4/50) for picked step (Inspection of B737-DC3.I#0 -105164233 => (P8) ).
DEBUG: [2013-01-16 09:12:47,838] Step index (262), time spend (4273), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/27) for picked step (Inspection of B737-DX7.I#1 1475783832 => TL).
DEBUG: [2013-01-16 09:12:47,842] Step index (263), time spend (4277), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/32) for picked step (Inspection of B737-DX7.I#0 1475783831 => TL).
DEBUG: [2013-01-16 09:12:47,846] Step index (264), time spend (4281), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/26) for picked step (Inspection of B747-AX1.I#1 2137587060 => TL).
...
DEBUG: [2013-01-16 09:27:17,903] Step index (16715), time spend (59977), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/49) for picked step (Inspection of B737-DX7.I#0 -105164233 => TL).
DEBUG: [2013-01-16 09:27:17,905] Step index (16716), time spend (59979), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/19) for picked step (Inspection of B737-DC3.I#1 2137587060 => TL).
DEBUG: [2013-01-16 09:27:17,908] Step index (16717), time spend (59982), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/43) for picked step (Inspection of B737-DX7.I#1 -105164232 => TL).
DEBUG: [2013-01-16 09:27:17,912] Step index (16718), time spend (59986), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/55) for picked step (Inspection of B747-AX1.I#1 1475783832 => TL).
DEBUG: [2013-01-16 09:27:17,915] Step index (16719), time spend (59989), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/41) for picked step (Inspection of B737-DC3.I#0 2137587059 => IV).
DEBUG: [2013-01-16 09:27:17,918] Step index (16720), time spend (59992), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/47) for picked step (Inspection of B737-DC3.I#1 2137587060 => IV).
DEBUG: [2013-01-16 09:27:17,922] Step index (16721), time spend (59996), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/62) for picked step (Inspection of B747-AX1.I#0 1475783831 => IV).
DEBUG: [2013-01-16 09:27:17,924] Step index (16722), time spend (59998), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/24) for picked step (Inspection of B737-DX7.I#1 -105164232 => IV).
DEBUG: [2013-01-16 09:27:17,926] Step index (16723), time spend (60000), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/25) for picked step (Inspection of B747-AX1.I#1 1475783832 => IV).
INFO : [2013-01-16 09:27:17,926] Phase localSearch ended: step total (16724), time spend (60000), best score (-242hard/0soft).
INFO : [2013-01-16 09:27:17,926] Solving ended: time spend (60000), best score (-242hard/0soft), average calculate count per second (22637).
isEveryProblemFactChangeProcessed: true
isTerminateEarly: false
Any ideas on how to move forward from here?
Thanks,
Michiel Vermandel
-----------------
http://www.codessentials.com - Your essential software, for free!
Follow us at http://twitter.com/#!/Codessentials
11 years, 3 months
Dates in an XLS decision table
by tad628
I'm new to Drools and trying to figure out how to build a condition around a
date. Using DRL, it might look something like this:
rule "Simple percentage with incentive date X"
when
$i : LineItem( status == LineItem.PROCESSING, $amount : amount,
$orderDate : orderDate )
then
Date $incentiveDate = new GregorianCalendar(2012, 0, 1).getTime();
Date $incentiveDate2 = new GregorianCalendar(2013, 0, 1).getTime();
if ( $orderDate.before( $incentiveDate ) )
....
else if ( $orderDate.before( $incentiveDate2 ) )
...etc.
I can't figure out how to do this in a spreadsheet, however. For the
condition I have the two lines below the "CONDITION" cell as:
LineItem
orderDate.before( $param )
with the various dates as rows down in the data section.
When I run this, I get an exception of that "unable to resolve method using
strict-mode: java.util.Date.before(java.lang.Double)"
How do I specify dates in the data field to get around this?
--
View this message in context: http://drools.46999.n3.nabble.com/Dates-in-an-XLS-decision-table-tp402154...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months