Re: [rules-users] Guvnor Declarative Model

2012-09-10 Thread Jean-Paul Shemali

Simply by not writing them in drools, but in another (proprietary) language, 
which in turn gets translated to drools at runtime. 
Of course there's nothing really simple about the translation and how the 
actual facts get generated

Date: Sat, 8 Sep 2012 23:53:47 +0200
From: vincent.legen...@eurodecision.com
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Guvnor Declarative Model

How can you declare your facts (or rules) if you don't know beforehand the 
structure of the POJO to use ?

___
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] Guvnor Declarative Model

2012-09-10 Thread Vincent LEGENDRE
Ok, not simple indeed ...
And why can't you generate a POJO instead of declarative fact ?

- Mail original -

De: Jean-Paul Shemali jshem...@hotmail.com
À: rules-users@lists.jboss.org
Envoyé: Lundi 10 Septembre 2012 10:06:43
Objet: Re: [rules-users] Guvnor Declarative Model


Simply by not writing them in drools, but in another (proprietary) language, 
which in turn gets translated to drools at runtime.
Of course there's nothing really simple about the translation and how the 
actual facts get generated




Date: Sat, 8 Sep 2012 23:53:47 +0200
From: vincent.legen...@eurodecision.com
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Guvnor Declarative Model


How can you declare your facts (or rules) if you don't know beforehand the 
structure of the POJO to use ?

___ 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] Issue with Drools Spring Integration documentation (v5.4)?

2012-09-10 Thread dunnlow
Isn't Example 2.3 (below) incorrect in the 5.4 Drools Spring integration doc? 
It looks like there are two problems.  First, a typo configurations should
be configuration (without the 's').  Secondly, according to the .xsd it
looks to me like batch and configuration elements must be mutually exclusive
(they are defined as a choice under ksession).  Am I misreading that?

(I ask because I'd like to actually have a script AND configuration section
in my ksession spring definition, but...)

xsd: 

 Example 2.3  
 drools:ksession id=ksession1 type=stateless 
  name=stateless1 kbase=kbase1/
 drools:ksession id=ksession2 type=stateful kbase=kbase1/
 drools:ksession id=ksession3 type=stateful kbase=kbase2

   drools:batch
  drools:insert-object ref=person /
  drools:set-global identifier=list1
  bean class=java.util.ArrayList /
  /drools:set-global
  drools:startProcess process-id=start fire 
   /drools:batch

   drools:configurations
 drools:keep-reference enabled=false /
 drools:clock-type type=PSEUDO  /
   /drools:configurations

 /drools:ksession
===

I'm looking here:
http://docs.jboss.org/drools/release/5.4.0.Final/droolsjbpm-integration-docs/html/ch.spring.html

Thanks,
-J



--
View this message in context: 
http://drools.46999.n3.nabble.com/Issue-with-Drools-Spring-Integration-documentation-v5-4-tp4019683.html
Sent from the Drools: User forum 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] Continuous Planning values for task planning

2012-09-10 Thread Josef Bajada
Hi Geoffrey,

I managed to implement the solution with the relative end Times. (I haven't
yet used the incremental score calculation because I haven't quite
understood how I implement it)

However I am facing one problem with our approach:

Lets say we have 3 tasks A, B, and C, each of duration 1 just for
simplicity, with these constraints:

a) B can only start between A.endTime + 10 and A.endTime + 100
b) C can only start between A.endTime + 50 and A.endTime + 100
c) C can only start between B.endTime + 10 and B.endTime + 20

With our approach of B.startTime = max(prev.endTime, A.endTime + 10)  B
will always be scheduled to start at time 11 (and end at time 12) given the
hard constraints above.
On the other hand C cannot start before time 51, thus violating constaint
C.

The only solution to this would be to move B forward to start at time 30.
Is there any technique to detect these situations and make such adjustments?

thanks again,

Josef




On 20 August 2012 09:46, Geoffrey De Smet ge0ffrey.s...@gmail.com wrote:

  You 'll want incremental score calculation (with delta's) for your end
 times.

 http://docs.jboss.org/drools/release/5.4.0.Final/drools-planner-docs/html_single/index.html#incrementalScoreCalculation

 So that naturally puts the calculation of those end times in the scoreDRL
 (or IncrementalJavaCalculator if you're not using drools).
 Whether or not that endTime should be a property on the model (at least
 the model that Planner works with), is an open design question.
 If it isn't, you can use insertLogicals in DRL, like I did in
 nurserostering to calculate the number of sequential weekends being worked
 etc.
 If it is a property on your model, either the DRL must first correct it
 (with higher salience rules for example),
 or custom moves must correct it as they are being done (which is very
 hard as it entails constraints functionality).

 As for the cloning: it's quite simple:
 Either the model's entity contains the endTime property, then clone it.
 If it doesn't, then there's nothing to clone.
 I don't see any problems related to the cloning.

 Op 18-08-12 01:53, Josef Bajada schreef:

 Hi Geoffrey,

  Following your advice and after gaining some more understanding of
 planner, I think approaching the problem as a chain of tasks one of the
 other makes sense. It would have some 'wait' time between tasks where the
 end time of the previous task is smaller than the minimum time the task has
 to wait after its dependency (which could be different from the previous
 task).

  I've noticed that in most examples (TSP and VRP), there is some
 separation between the model and the planning entity that is being moved
 around in the chain, which also makes sense. (For instance in TSP, Visit is
 the planning entity while City is the data entity). When the planning
 entity gets cloned, the data entity gets assigned to the clone.

  I am concerned however, that with my dependency between tasks and their
 end times (which are as such a property of the planning entity not the data
 entity) I won't be able to model them in this way. (For a task to know
 whether it has violated its hard constraint it needs to get access to the
 end time of its dependency, which is in the planning entity). My concern is
 that I might end up with a whole mess when it comes to the cloning of
 tasks. I am also concerned about the performance of computing the end time
 of each node recursively based on its previous task and dependent tasks.

  What is the best approach in this case?

  thanks,

 Josef



 On 25 July 2012 08:30, Geoffrey De Smet ge0ffrey.s...@gmail.com wrote:


 Op 24-07-12 23:14, Josef Bajada schreef:

 Hi Geoffrey,

  Thanks for your reply.

   Does it make sense to wait longer than 7 mins after task A (presuming
 no other task forces occupies the user at that time)?
  Put differently: Can we say that the starting time of B =
 Math.max((endTime of task before B), (endTime of task A + 7 minutes))?
  If we can say that, it's pointless to investigate the solutions where
 task B starts 8 minutes after task A and the user doing no task that last
 minute.

  Yes, the starting time of B = Math.max((endTime of task before B),
 (endTime of task A + 7mins)) as long as it is smaller than (endTime of task
 A + 8mins).
 Yes, it is pointless to investigate the solutions where task B starts 8
 minutes after task A and the user doing no task that last minute.
 The 8 minute is just a constraint that the task in between tasks A and B
 cannot take longer than 7:59s.

  I am thinking that maybe instead of using time itself as the planning
 variable, we would use time just to determine the Hard and Soft scores.
 So if Task B is scheduled after Task A + 8mins by the solver, then it
 inflicts on the hard score. Similarly if Task B is scheduled before Task A
 + 7 mins.
 Does my reasoning make sense in any way?

 Yes, but personally, I 'd design it differently (although I have no proof
 that my way would be better), like this: