Accumulate function
by Matteo Cusmai
Hi all,
i am going to use a custom accumulate function like that:
rule "CrowdInAreaEvent-event"
no-loop
when
$RFIDReader : SensorFixed(type == Sensor.SENSOR_TYPE_RFID,
$coverageArea : areaOfInterest )
not CrowdInAreaEvent( sensor == $RFIDReader, this meets[ 5s ] $obs )
$count : Integer( intValue > 10 )
from accumulate( $obs : RFIDObservation( $tagid : tagid, sensor
== $RFIDReader )
over window:time( 60s ) from entry-point lowLevelSensorStream,
countDistinct( $tagid ) );
then
insert( SituationManager.createCrowdInAreaEvent( "Crowd, number
people: " + $count, Event.THREAT_LOW, $coverageArea, $RFIDReader, $count,
60, 10 ) );
end
I need to refer $obs object in order to compare timing of new observation
with last event. Is it possible to do that?
Thanks a lot,
Matteo.
13 years, 7 months
[Planner]Sudoku solver
by Qchevalier
Hi everybody,
In order to understand better Planner, I did a sudoku solver. I was inspired
by Queens example.
I need 3 minutes to solve a sudoku with localSearch .
*I have 2 issues :*
1- Construction Heuristic doesn't work at all : I don't understand why.
2- I use FROM_PLANNING_ENTITY_PROPERTY for my @PlanningVariable. The
@ValueRange is a collection of Value : [value1, value2, value3, value4,
value5, value6, value7, value8, value9]. => But this range isn't used in the
localSearch. Instead I think localSearch uses the value list
FROM_SOLUTION_PROPERTY.
I share my code on GitHub : git@github.com:qchevalier/Sudoku-solver.git
*[To understand my code]*
Firstly I use the API configuration : you will have to change the path of
the drl file in App.java(line 36), and put away the xml configuration file.
A sudoku is composed by 81 digits : each digit has 1 value, 1 column, 1 row
and 1 block.
1 value has a value between [1-9] (Value can be initialized; in this case
they can't be changed during solving. 0 is undefined value and has to be
changed).
1 column has an index with a value between [0-8].
1 row has an index with a value between [0-8].
1 block has an index with a value between [0-8].
http://drools.46999.n3.nabble.com/file/n4005002/sudoku_how_to.png
In order to initialize the sudoku I use methods initTab* from
NDigitsGenerator.java .
After get it on github (git@github.com:qchevalier/Sudoku-solver.git ):
In order to run the application : import it in eclipse, modify the path of
the DRL file, and then run as java application "App.java".
*A sample of the execution can be as this : *
2012-05-21 11:19:08,332 [main] INFO Solving started: time spend (218),
score (-508), new best score (-508), random seed (0).
/2012-05-21 11:19:08,332 [main] INFO Phase constructionHeuristic ended:
step total (0), time spend (234), best score (-508)./
2012-05-21 11:19:10,910 [main] DEBUG Step index (0), time spend (2812),
score (-485), new best score (-485), accepted move size (1948) for picked
step (col8@row2@block6@value0 => value1)
...
2012-05-21 11:21:55,909 [main] DEBUG Step index (88), time spend
(167811), score (-3), best score (-2), accepted move size (1797) for
picked step (col0@row7@block2@value3 => value6).
2012-05-21 11:21:57,643 [main] DEBUG Step index (89), time spend
(169545), score (-2), best score (-2), accepted move size (1795) for
picked step (col0@row7@block2@value3 => value6).
2012-05-21 11:22:09,815 [main] DEBUG Step index (96), time spend
(181717), score (-3), best score (-2), accepted move size (1797) for
picked step (col0@row3@block1@value6 => value3).
2012-05-21 11:22:11,534 [main] DEBUG Step index (97), time spend
(183436), score (0), new best score (0), accepted move size (1796) for
picked step (col2@row3@block1@value3 => value6).
2012-05-21 11:22:11,534 [main] INFO Phase localSearch ended: step total
(98), time spend (183436), best score (0).
2012-05-21 11:22:11,534 [main] INFO Solving ended: time spend (183436),
best score (0), average calculate count per second (984).
Solved sudoku:
I-------------I-------------I-------------I
I | 9 | 4 | 2 | I | 3 | 1 | 5 | I | 6 | 8 | 7 |I
I | 8 | 3 | 1 | I | 2 | 7 | 6 | I | 4 | 5 | 9 |I
I | 7 | 6 | 5 | I | 8 | 4 | 9 | I | 2 | 3 | 1 |I
I-------------I-------------I-------------I
I | 3 | 5 | 6 | I | 9 | 2 | 7 | I | 8 | 1 | 4 |I
I | 4 | 7 | 9 | I | 1 | 5 | 8 | I | 3 | 2 | 6 |I
I | 2 | 1 | 8 | I | 4 | 6 | 3 | I | 9 | 7 | 5 |I
I-------------I-------------I-------------I
I | 1 | 9 | 7 | I | 6 | 8 | 2 | I | 5 | 4 | 3 |I
I | 6 | 2 | 4 | I | 5 | 3 | 1 | I | 7 | 9 | 8 |I
I | 5 | 8 | 3 | I | 7 | 9 | 4 | I | 1 | 6 | 2 |I
I-------------I-------------I-------------I
--
View this message in context: http://drools.46999.n3.nabble.com/rules-users-Planner-Sudoku-solver-tp400...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 months
custom lib in guvnor
by Olle Martensson
How can I use a custom lib/jar in guvnor.
What I want to do is to call some framework specific methods from the action part of the rules.
Thanks! // Olle
13 years, 7 months
Guvnor - support for custom file extensions
by anchi
Hi!
I need to extend Guvnor to support custom file extensions for BPMN
processes. So instead of using "/.bpmn/" or "/.bpmn2/" we need to use our
own file extensions. At the moment Guvnor just assumes them the to be /Other
assets/ and ignores them when building a package.
I plan to change Guvnor source to achieve this. I would appreciate if I get
some guidelines from dev-team, what classes do I have to change. Since you
have recently been adding support for "/.bpmn2/" extension, I guess you
could give me some hints.
I found out that I have to add my extensions to
/org.drools.guvnor.client.common.AssetFormats/, change
/org.drools.guvnor.server.builder.AssetItemValidator/ and
/org.drools.guvnor.server.verification.AssetVerifier/ . Is there something
else?
Thanks!
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-support-for-custom-file-extensio...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 months
2nd CFP - 6th Int. Workshop on Event-Driven Business Process Management (edBPM12)
by Adrian Paschke
[ our apologies should you receive this message more than one time ]
6th Int. Workshop on Event-Driven Business Process Management (edBPM12)
collocated with BPM 2012
Tallinn, Estonia, 3-7 September 2012
http://icep-edbpm12.fzi.de/
++++ SUBMISSION DEADLINE - JUNE 1st +++++
Workshop Themes
--------------------------
Authors are invited to submit novel contributions in the prior described
problem domain.
* Event-driven BPM: Concepts
o Role of event processing in BPM
o Business Events: types and representation
o Event stream processing in business processes
o Data- and event-driven business processes
o Evaluation/ROI of event-driven BPM
o Event-driven SOA
o EDA and BPM
o Real/time awareness in BPM
o Context in BPM
* Design-time CEP and BPM
o Modelling languages, notations and methods for event-driven BPM
o Event Patterns: Definition / Creation / Representation /
Learning
o BPMN and event processing
o Modelling unknown/similar events in business processes
o Modelling events in human-oriented tasks
o Semantics/Ontologies for event-driven BPM
o Publish/subscription mechanism and process modelling
* Run-time CEP and BPM
o Event pattern detection
o BPEL and event processing
o Reasoning about unknown/similar events
o Distributed event processing
o Dynamic workflows
o Ad-hoc workflows
* Applications/Use cases for event-driven BPM
o Event-driven monitoring/BAM
o Event-driven SLA monitoring
o Domains: Logistics, Automotive, .
o Event processing and Internet of Services
Important Dates
--------------------------
Deadline paper submissions: 1 June 2012
Notification of acceptance: 2 July 2012
Camera-ready papers: 30 July 2012
Workshops: 3 September 2012
Submission
--------------------------
The following types of submission are solicited:
- Long paper submissions, describing substantial contributions of novel
ongoing work. Long papers should be at most 12 pages long.
- Short paper submissions, describing work in progress. These papers should
be at most 6 pages long.
- Use case submission, describing results from an edBPM use case. These
papers should be at most 4 pages long.
Papers should be submitted in the new LNBIP format
(http://www.springer.com/computer/lncs?SGWID=0-164-6-791344-0). Papers have
to present original research contributions not concurrently submitted
elsewhere. The title page must contain a short abstract, a classification of
the topics covered, preferably using the list of topics above, and an
indication of the submission category (Long Paper/ Short Paper). Accepted
paper will be published in the joint workshops proceeding (Springer).
For submission, please visit
http://www.easychair.org/conferences/?conf=edbpm12.
Organizing Committee
--------------------------
Nenad Stojanovic
FZI - Research Center for Information Technologies at the University of
Karlsruhe, Germany.
nstojano (at) fzi dot de
Opher Etzion
IBM Research Lab in Haifa
OPHER (at) il dot ibm dot com
Adrian Paschke
Corporate Semantic Web, Free University Berlin, Germany and RuleML Inc.,
Canada
paschke (at) inf dot fu-berlin dot de
Christian Janiesch
Karlsruhe Institute of Technology (KIT)
Christian.Janiesch (at) kit dot edu
--
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!
Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a
13 years, 7 months
Object activiates same rule many times
by Christina Lau
Hi all,
I find an odd pattern in the audit log. When an Object is inserted to the
working memory, activation is created many times on same rule. The more
objects are inserted, the duplicated activations are growing exponentially
which degrade the performance a lot.
Here attached part of the audit log:
http://drools.46999.n3.nabble.com/file/n4000630/rule-DOCSEP-1337325521971...
rule-DOCSEP-1337325521971.log
In the log,
- when object (130) is inserted, rule "C020 - Gate charge (Out M)-B" is
activiated 129 times.
- when object (131) is inserted, rule "C020 - Gate charge (Out M)-B" is
activiated 130 times.
Here is the rule of "C020 - Gate charge (Out M)-B",
The "insert" in RHS only add ChargeDetailRefSeqEntity to working memory that
I don't think it causes the recursive activation.
And I'd already set no-loop to true. Does anyone offer some help here?
Thank you very much,
Christina
--
View this message in context: http://drools.46999.n3.nabble.com/Object-activiates-same-rule-many-times-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 months
Drools verifier - redundancy detection
by bitter
I would like to use drools-verifier to detect redundancy in my drl files. But
drools-verifier can not detect redundancy even in simple drl. Maybe I do
something wrong ;/.
*Simple drl file:*
rule "rule 1"
when
$person: Person(age==16, name=="Anna")
then
retract($person);
end
rule "rule 4"
when
$person: Person(age==16, name=="Anna")
then
retract($person);
end
*And my test:*
@Test
public void verifyRules() {
//given
VerifierBuilder vbuilder = VerifierBuilderFactory.newVerifierBuilder();
Verifier verifier = vbuilder.newVerifier();
verifier.addResourcesToVerify(new
ClassPathResource("qualityVerification.drl", getClass()), ResourceType.DRL);
if (verifier.hasErrors()) {
for(VerifierError ve : verifier.getErrors()) {
System.out.println(ve.getMessage());
}
throw new RuntimeException("ERRORS ");
}
//when
verifier.fireAnalysis();
//then
VerifierReport report = verifier.getResult();
System.out.println(">>>>>>>>> ERRORS: ");
for(VerifierMessageBase vmb : report.getBySeverity(Severity.ERROR)) {
System.out.println(vmb + ". Type: " + vmb.getMessageType());
}
System.out.println(">>>>>>>>> WARNINGS: ");
for(VerifierMessageBase vmb : report.getBySeverity(Severity.WARNING)) {
System.out.println(vmb + ". Type: " + vmb.getMessageType());
}
System.out.println(">>>>>>>>> NOTES: ");
for(VerifierMessageBase vmb : report.getBySeverity(Severity.NOTE)) {
System.out.println(vmb + ". Type: " + vmb.getMessageType());
}
System.out.println(">>>>>>>>> MISSING RANGE: ");
for(MissingRange mr : report.getRangeCheckCauses()) {
System.out.println(mr);
}
}
*OUTPUT:*
>>>>>>>>> ERRORS:
>>>>>>>>> WARNINGS:
Warning id = 0:
faulty : LiteralRestriction from rule [rule 4] value '== Anna'
Rule base covers == Anna, but it is missing != Anna
Cause trace:
. Type: MISSING_EQUALITY
Warning id = 1:
faulty : LiteralRestriction from rule [rule 4] value '== 16'
Rule base covers == 16, but it is missing != 16
Cause trace:
. Type: MISSING_EQUALITY
Warning id = 2:
faulty : LiteralRestriction from rule [rule 1] value '== Anna'
Rule base covers == Anna, but it is missing != Anna
Cause trace:
. Type: MISSING_EQUALITY
Warning id = 3:
faulty : LiteralRestriction from rule [rule 1] value '== 16'
Rule base covers == 16, but it is missing != 16
Cause trace:
. Type: MISSING_EQUALITY
>>>>>>>>> NOTES:
>>>>>>>>> MISSING RANGE:
Gap: (Field 'age' from object type 'Person') Operator = '<' 16 from rule:
[rule 4]
Gap: (Field 'age' from object type 'Person') Operator = '>' 16 from rule:
[rule 4]
Gap: (Field 'age' from object type 'Person') Operator = '<' 16 from rule:
[rule 1]
Gap: (Field 'age' from object type 'Person') Operator = '>' 16 from rule:
[rule 1]
Is it a bug or I do something wrong?
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-verifier-redundancy-detection-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 months
KnowledgeRuntimeLogger file logger
by bitter
I registered file KnowledgeRuntimeLogger (logging output will be similar to
that generated by the registered WorkingMemoryEventListener) and trying to
analize output xml.
Here is output content:
<object-stream>
<org.drools.audit.event.ActivationLogEvent>
<type>4</type>
<activationId>check education - nvq [1]</activationId>
<rule>check education - nvq</rule>
<declarations>$creditApplication=CreditApplication{scoringResult=0,
clientAge=27, clientEducation=NVQ}(1)</declarations>
</org.drools.audit.event.ActivationLogEvent>
<org.drools.audit.event.ObjectLogEvent>
<type>1</type>
<factId>1</factId>
<objectToString>CreditApplication{scoringResult=0, clientAge=27,
clientEducation=NVQ}</objectToString>
</org.drools.audit.event.ObjectLogEvent>
<org.drools.audit.event.ActivationLogEvent>
<type>6</type>
<activationId>check education - nvq [1]</activationId>
<rule>check education - nvq</rule>
<declarations>$creditApplication=CreditApplication{scoringResult=0,
clientAge=27, clientEducation=NVQ}(1)</declarations>
</org.drools.audit.event.ActivationLogEvent>
<org.drools.audit.event.ActivationLogEvent>
<type>7</type>
<activationId>check education - nvq [1]</activationId>
<rule>check education - nvq</rule>
<declarations>$creditApplication=CreditApplication{scoringResult=20,
clientAge=27, clientEducation=NVQ}(1)</declarations>
</org.drools.audit.event.ActivationLogEvent>
</object-stream>
Could anyone explain me why ACTIVATION_CREATED ( type 4) event is logged
before INSERT( type 1) event?
--
View this message in context: http://drools.46999.n3.nabble.com/KnowledgeRuntimeLogger-file-logger-tp40...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 months
Classnotfound exception on POJO model upload in guvnor
by mpgong
Hello,
I'm trying to use Guvnor but when i upload my POJO models that my DRL needs
i get a classnotfoundexception even though i uploaded the jar that has the
class in it first.
So i basically upload a jar that provides some common classes,utilities,
that have no dependencies other than on the core java libs. This jar
uploads fine. I then upload my model jar that contains my facts and other
classess that the DRL needs and it complains that it can't find the class
from the first common jar even though i uploaded it first and it is loaded
without errors.
How do i load all of my jars so that they are available in Guvnor to use
such as in creating a test scenario? It looks like the jars are upload but
i get the error, i can also build the package but i'm worried it won't work
when i try to use it in my app. Any ideas or insight to this issue.
I'm using drools.5.3.0 final.
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Classnotfound-exception-on-POJO-model-u...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 months