[rules-users] Non Spatial Map Reduce

2014-03-12 Thread john poole
I was reading the blog
http://www.optaplanner.org/blog/2014/03/03/CanMapReduceSolvePlanningProblems.html

and although the unsuitability of the spatial division of the problem makes
sense, I'd like to understand why the problem can't be broken up
differently. i.e. why can't any solution be loaded into n separate solvers
with 1/nth of the moves, and then send the best solution to all the solvers,
and repeat?



--
View this message in context: 
http://drools.46999.n3.nabble.com/Non-Spatial-Map-Reduce-tp4028652.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


[rules-users] Workbench on tomcat

2014-03-04 Thread john poole
I'm sure I'm being dense, but I can't reconcile the readme instructions with
the file I see in the workbench app:

1. Copy kie-tomcat-integration jar into TOMCAT_HOME/lib
*Where is this file?

2. Copy jacc lib into TOMCAT_HOME/lib (javax.security.jacc-api in jboss
maven repository)
*What is the file name for jacc lib and where is it?

3. Add valve configuration into TOMCAT_HOME/conf/server.xml inside Host
element as last valve definition
Valve className=org.kie.integration.tomcat.JACCValve /
4. Edit TOMCAT_HOME/conf/tomcat-users.xml to include roles and users, make
sure there will be 'analyst' or 'admin' roles defined as it's required to be
authorized to use kie-wb
5. Edit web.xml and uncomment all entries that are marked with
TOMCAT-JEE-SECURITY
*There are no entries marked with TOMCAT-JEE-SECURITY in that file.

6. Rename org.uberfire.security.auth.AuthenticationSource to
org.uberfire.security.auth.AuthenticationSource-ORIGIN and
rename  org.uberfire.security.auth.AuthenticationSource-TOMCAT-JEE-SECURITY
to org.uberfire.security.auth.AuthenticationSource
inside WEB-INF/classes/META-INF/services
*There isn't an uberfire folder under the org folder there.




--
View this message in context: 
http://drools.46999.n3.nabble.com/Workbench-on-tomcat-tp4028507.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] OutOfMemoryError using 6.0.1

2014-02-20 Thread john poole
I used yesterday's 6.1.0 nightly and the problem wasn't there. Will using the
6.0.x snapshot be any different?



--
View this message in context: 
http://drools.46999.n3.nabble.com/OutOfMemoryError-using-6-0-1-tp4028183p4028210.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] OutOfMemoryError using 6.0.1

2014-02-19 Thread john poole
That was exactly what I was hoping for. A bug, not caused by me, that
had already been closed.
Thanks.

On Wed, Feb 19, 2014 at 5:13 AM, tari-manga [via Drools]
ml-node+s46999n4028191...@n3.nabble.com wrote:
 Ciao, I'm another Drools user also encountering similar OutOfMemory errors
 with v6.0.1; I'm not 100% sure what is your issue specific to, but this may
 be related / of interest to your case:
 https://issues.jboss.org/browse/DROOLS-411

 Hope this helps;
 Ciao
 MM


 On Wed, Feb 19, 2014 at 8:20 AM, john poole [hidden email] wrote:

 I've converted some NurseRostering rules, which worked in Drools 5.50, to
 OptaPlanner 6.0.1. While it works far better for the time it runs, it uses
 up whatever memory I can give it (9GB) and then eventually crashes the
 GUI.

 with:
 Exception in thread AWT-EventQueue-0 java.lang.OutOfMemoryError: GC
 overhead limit exceeded

 Is there a way to limit how much memory OptaPlanner uses? Or is it likely
 that I'm just adding fact to the WorkingMemory in a way that wasn't a
 problem in 5.5 but is a problem in 6.0?





 --
 View this message in context:
 http://drools.46999.n3.nabble.com/OutOfMemoryError-using-6-0-1-tp4028183.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 [hidden email]
 https://lists.jboss.org/mailman/listinfo/rules-users



 ___
 rules-users mailing list
 [hidden email]
 https://lists.jboss.org/mailman/listinfo/rules-users

 
 If you reply to this email, your message will be added to the discussion
 below:
 http://drools.46999.n3.nabble.com/OutOfMemoryError-using-6-0-1-tp4028183p4028191.html
 To unsubscribe from OutOfMemoryError using 6.0.1, click here.
 NAML




--
View this message in context: 
http://drools.46999.n3.nabble.com/OutOfMemoryError-using-6-0-1-tp4028183p4028196.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

[rules-users] OutOfMemoryError using 6.0.1

2014-02-18 Thread john poole
I've converted some NurseRostering rules, which worked in Drools 5.50, to
OptaPlanner 6.0.1. While it works far better for the time it runs, it uses
up whatever memory I can give it (9GB) and then eventually crashes the GUI.

with:
Exception in thread AWT-EventQueue-0 java.lang.OutOfMemoryError: GC
overhead limit exceeded 

Is there a way to limit how much memory OptaPlanner uses? Or is it likely
that I'm just adding fact to the WorkingMemory in a way that wasn't a
problem in 5.5 but is a problem in 6.0?





--
View this message in context: 
http://drools.46999.n3.nabble.com/OutOfMemoryError-using-6-0-1-tp4028183.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] Long pattern for Nurse Rostering

2013-08-11 Thread john poole
That does make sense. It sounds like I should be adding the facts as domain
objects where the index is available instead of generating them during the
solution. I was trying to reuse the existing ShiftType3DaysPattern class
from the nursing example, but used more than I should have.
The code I have is almost working, but it seems to create plateaus. I can
give it a push by stopping the GUI, making some changes,  and then
restarting. So I'll add another rule to do that on it's own. I feel like I'm
building a kludgy house of cards though.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Long-pattern-for-Nurse-Rostering-tp4025432p4025452.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] Long pattern for Nurse Rostering

2013-08-10 Thread john poole
Thanks for the reply. The series of shifts that a Doctor works in my schedule
is 15 days straight, but not the same Shift for each of those days.
I ended up doing it like this, maybe it explains the requirements better.
Its working, but it looks ugly.

rule pattern15dayShiftAssignment
when
$pattern : Neuro15DaysPattern(  
$dayOfWeekFirst : getDayOfWeek(0),
$shiftType0: getShiftType(0),
$shiftType1: getShiftType(1),
$shiftType2: getShiftType(2),
$shiftType3: getShiftType(3),
$shiftType4: getShiftType(4),
$shiftType5: getShiftType(5),
$shiftType6: getShiftType(6),
$shiftType7: getShiftType(7),
$shiftType8: getShiftType(8),
$shiftType9: getShiftType(9),
$shiftType10: getShiftType(10),
$shiftType11: getShiftType(11),
$shiftType12: getShiftType(12),
$shiftType13: getShiftType(13),
$shiftType14: getShiftType(14)
 );
then
insertLogical( new PatternShiftAssignment($pattern,  
$shiftType1, 1) );
insertLogical( new PatternShiftAssignment($pattern,  
$shiftType2, 2) ); 
insertLogical( new PatternShiftAssignment($pattern,  
$shiftType3, 3) ); 
insertLogical( new PatternShiftAssignment($pattern,  
$shiftType4, 4) ); 
insertLogical( new PatternShiftAssignment($pattern,  
$shiftType5, 5) ); 
insertLogical( new PatternShiftAssignment($pattern,  
$shiftType6, 6) ); 
insertLogical( new PatternShiftAssignment($pattern,  
$shiftType7, 7) ); 
insertLogical( new PatternShiftAssignment($pattern,  
$shiftType8, 8) ); 
insertLogical( new PatternShiftAssignment($pattern,  
$shiftType9, 9) ); 
insertLogical( new PatternShiftAssignment($pattern,  
$shiftType10, 10) );
insertLogical( new PatternShiftAssignment($pattern,  
$shiftType11, 11) );   
insertLogical( new PatternShiftAssignment($pattern,  
$shiftType11, 11) );   
insertLogical( new PatternShiftAssignment($pattern,  
$shiftType12, 12) );   
insertLogical( new PatternShiftAssignment($pattern,  
$shiftType13, 13) );   
insertLogical( new PatternShiftAssignment($pattern,  
$shiftType14, 14) );   
System.out.println( $pattern + +  $shiftType14 );
end

rule unwantedPatternNeuro15Days
when 
$pattern : Neuro15DaysPattern($dayOfWeekFirst : getDayOfWeek(0),
$shiftType0: getShiftType(0), $code : code);

PatternShiftAssignment( pattern == $pattern, $shiftType : shiftType,
$dayIndex: patternIndex)

  
$shiftAssignment0 : ShiftAssignment($code == shiftDateDayIndex %
2,
shiftType == 
$shiftType0, 

shiftDateDayOfWeek == $dayOfWeekFirst, 
$employee: 
employee,

$shiftDateDayIndex0 : shiftDateDayIndex);

  
$shiftassignment : ShiftAssignment( shiftType == $shiftType,
shiftDateDayIndex ==
($dayIndex+$shiftDateDayIndex0),
$employee !=
employee 
)
   
then
insertLogical(new
IntConstraintOccurrence(unwantedPatternNeuro15Days,  
 ConstraintType.NEGATIVE_SOFT,
$pattern.getWeight(),
$employee, $pattern, $dayIndex));
end



--
View this message in context: 
http://drools.46999.n3.nabble.com/Long-pattern-for-Nurse-Rostering-tp4025432p4025444.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


[rules-users] Long pattern for Nurse Rostering

2013-08-08 Thread john poole
I'm trying to create a rule for a 15 day pattern. When the patterns uses the
same shift for all 15 days, I do this:

rule unWanted15DayPattern
when
$pattern : U15DayPattern(
$numberOfDays : numberOfDays,
$shiftType : shiftType
)

ShiftAssignment(
shiftType == $shiftType,
$employee : employee, 
$firstDayIndex : shiftDateDayIndex
)

ShiftDate( $firstDayIndex == dayIndex, dayIndex % 15 == 0)

//Check for different employee working that shift in the next N days
   $shiftAssignment : ShiftAssignment(
shiftType == $shiftType,
employee != $employee,
shiftDateDayIndex  $firstDayIndex,
shiftDateDayIndex  $firstDayIndex + 15
)
   
then   
   
 insertLogical(new IntConstraintOccurrence(unWanted15DayPattern,
ConstraintType.NEGATIVE_SOFT,
   $pattern.getWeight(),
$firstDayIndex));
end

But I'm having a hard time figuring out how to do it with different
shiftTypes for each day, because it means having to use a loop. 
Not sure if that makes sense, but it anyone has used a long pattern that
stores items in a list/array I'd love to hear how they did it.




--
View this message in context: 
http://drools.46999.n3.nabble.com/Long-pattern-for-Nurse-Rostering-tp4025432.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] Wanted Patterns in Planner/Rostering

2013-07-21 Thread john poole
Thanks. It was simple once I knew it was going to work. Writing rules is very
intuitive when I'm doing them daily, but if I take a couple of months off I
lose the touch.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Wanted-Patterns-in-Planner-Rostering-tp4025016p4025064.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


[rules-users] Wanted Patterns in Planner/Rostering

2013-07-17 Thread john poole
I'm using the Nurse Rostering code as a base and adding my own rules, etc.
Are there any examples of wanted patterns? It looks like all the input
files, and the drl rules are all for unwanted patterns. I just want to
make sure I'm not missing something obvious.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Wanted-Patterns-in-Planner-Rostering-tp4025016.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


[rules-users] shiftAssignment change

2013-04-02 Thread john poole
I'm trying to write a simple web application that uses much of the code from
the NurseRostering example. It all works great except when I try to do a
change move after terminating solving. 

In: DroolScoreDirector.afterVariableChanged() for the ShiftAssignment, I get
a null back from this:
FactHandle factHandle = workingMemory.getFactHandle(entity);

My guess is that it's because it's a different copy of the workingMemory
than the entity is coming from, but I'm not sure how to access the correct
copy.

I'm getting the ShiftAssigment from:
NurseRoster nurseRoster = (NurseRoster) solutionBusiness.getSolution();

ListShiftAssignmentshiftAssignmentList=nurseRoster.getShiftAssignmentList();

and then attempting the move from:
solutionBusiness.doMove(new EmployeeChangeMove(shiftAssignment,
toEmployee));

Is there something else I need to do after terminating solving before doing
a changemove?



--
View this message in context: 
http://drools.46999.n3.nabble.com/shiftAssignment-change-tp4023179.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] shiftAssignment change

2013-04-02 Thread john poole
Ignore this, I was getting the shift assignment list from the wrong solution.



--
View this message in context: 
http://drools.46999.n3.nabble.com/shiftAssignment-change-tp4023179p4023184.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] Found solution vs actual optimum [planner]

2013-02-11 Thread john poole
I went through and ran some stepLimit benchmarks, commenting out single rules
at a time, or groups of rules that were dependent on each other. average
calculate count per second stayed fairly consistent at around 825 to 850,
except for the consecutive working day rules.( Which were already in the
drl file before I added mine, but do apply to the schedules I'm working on)
I commented out the group, then uncommented them in sequence. 

Everything below a score is commented out:

1487(entire group commented out)
rule insertEmployeeConsecutiveAssignmentStart
1308
rule insertEmployeeConsecutiveAssignmentEnd
1244
rule insertEmployeeWorkSequence
1054
rule minimumConsecutiveWorkingDays
1081
rule maximumConsecutiveWorkingDays
988
rule insertEmployeeFreeSequence
994   
rule insertFirstEmployeeFreeSequence
902  
rule insertLastEmployeeFreeSequence
854  
rule insertEntireEmployeeFreeSequence
938 
rule minimumConsecutiveFreeDays
895   
rule maximumConsecutiveFreeDays
851 (nothing commented out)





--
View this message in context: 
http://drools.46999.n3.nabble.com/Found-solution-vs-actual-optimum-tp4022027p403.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] Found solution vs actual optimum [planner]

2013-02-08 Thread john poole
I ran the benchmarker and it's showing that I should be using simulated
annealing. So that's useful info.

I'm only getting 525-650 for the average calculate count per second though.
(I didn't realize I could get it without the benchmarker until reading the
docs again)

I'm going through Score calculation performance tricks now, but I didn't
see anything about the hardware used for the expected 1000 value. If my
older laptop is sort of crappy( a Pentium(R)2.2GHz), that would explain the
difference, correct?



--
View this message in context: 
http://drools.46999.n3.nabble.com/Found-solution-vs-actual-optimum-tp4022027p4022175.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] Found solution vs actual optimum [planner]

2013-02-05 Thread john poole
Better than other algorithms is what I'm after.

The output from the sample data sets is excellent. So easy to scan through
and understand all the results immediately. Anyone that hasn't used it
should give it a try.

 I'm running the benchmarker on my inputs and rules now. I'm just using the
Nurse Rostering example with different inputs and a few more rules, but it's
been taking me around 6 hours to get the score I expect.

I'm also using planner to try and show cases where an acceptable solution
can't be found, and I'll be more confident knowing I'm tried all the
methods.

Thanks.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Found-solution-vs-actual-optimum-tp4022027p4022073.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] Found solution vs actual optimum [planner]

2013-02-04 Thread john poole
Thanks. If the Best score over time line doesn't flatline, does that mean
it needs more time or that the configuration isn't ever going to produce a
good solution?



--
View this message in context: 
http://drools.46999.n3.nabble.com/Found-solution-vs-actual-optimum-tp4022027p4022053.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


[rules-users] Found solution vs actual optimum

2013-02-03 Thread john poole
Is there a way to describe how the solutions found in planner compare to the
true optimum solutions? 

In  chapter 6
http://docs.jboss.org/drools/release/5.5.0.Final/drools-planner-docs/html/optimizationAlgorithms.html
  
of the docs it rates the methods used as 4/5 for finding an optimal
solution. Does that mean:  a) it will do a good job of finding the optimum,
or b) that the solution it finds will be close to an optimum?



--
View this message in context: 
http://drools.46999.n3.nabble.com/Found-solution-vs-actual-optimum-tp4022027.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] Planner - NurseRostering: MaxWorkingWeekendsInFourWeeks

2013-01-22 Thread john poole
Thanks. It's a different rule, but it's good to know that I'm not duplicating
something.




--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Planner-NurseRostering-MaxWorkingWeekendsInFourWeeks-tp4021702p4021743.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


[rules-users] Planner - NurseRostering: MaxWorkingWeekendsInFourWeeks

2013-01-21 Thread John Poole
The parameters for MaxWorkingWeekendsInFourWeeks is in some of the
input files for the NurseRostering example, but it doesn't seem to be
the rules(drl) file.
Is it implemented elsewhere? I've tried doing is like this, but it
doesn't work as a HARD constraint. I'm running it as SOFT now, but  it
would nice to compare it to a better version.

//Rules for workingweekends
rule insertWorkingWeekends
when
MinMaxContractLine(contractLineType ==
ContractLineType.TOTAL_WORKING_WEEKENDS_IN_FOUR_WEEKS, enabled ==
true,
$contract : contract)
$employee : Employee(contract == $contract)
ShiftAssignment(employee == $employee, $shiftDateDayIndex :
shiftDate.dayIndex, weekend == true)
then
insertLogical(new WorkingWeekend($employee, $shiftDateDayIndex/7));
end

// Maximum working weekends in four weeks
rule insertWorkingWeekendsInFourWeeks
   // salience 1 // Do these rules first (optional, for performance)
when
MinMaxContractLine(contractLineType ==
ContractLineType.TOTAL_WORKING_WEEKENDS_IN_FOUR_WEEKS, enabled ==
true,
$contract : contract)
$employee : Employee(contract == $contract)
WorkingWeekend(employee == $employee, $week: week)
$workingWeekendTotal : Number() from accumulate(
$workingWeekend : WorkingWeekend(employee == $employee,
week = $week, week-$week  3 ),
count($workingWeekend)
)
then
insertLogical(new WorkingWeekendTotalFourWeeks($employee,
$workingWeekendTotal.intValue(), $week));
end


// Maximum working weekends in four weeks
rule maxWorkingWeekendsInFourWeeks
when
$contractLine : MinMaxContractLine(
contractLineType ==
ContractLineType.TOTAL_WORKING_WEEKENDS_IN_FOUR_WEEKS, maximumEnabled
== true,
$contract : contract, $maximumValue : maximumValue
)
$employee : Employee(contract == $contract)
WorkingWeekendTotalFourWeeks(employeeContract == $contract,
total  $maximumValue,
 employee==$employee, $total : total, $week : week)
then
insertLogical(new
IntConstraintOccurrence(maxWorkingWeekendsInFourWeeks,
ConstraintType.NEGATIVE_SOFT,
($total - $maximumValue) * $contractLine.getMaximumWeight(),
$employee, $week));
end
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Rules Unit Testing

2012-12-04 Thread John Poole
How is unit testing handled for rules? I'm playing with the nurse
rostering app and the only test I see is a performance test.

-John
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users