[jboss-svn-commits] JBL Code SVN: r17340 - labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Dec 20 10:34:57 EST 2007
Author: shabino
Date: 2007-12-20 10:34:57 -0500 (Thu, 20 Dec 2007)
New Revision: 17340
Modified:
labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/LogicalTopTier.dslr
labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/Queries.drl
labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/ScoreManagement.dslr
labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/Scoring.dslr
labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/dispatch.dsl
Log:
Minor logic changes to dispatch rules
Modified: labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/LogicalTopTier.dslr
===================================================================
--- labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/LogicalTopTier.dslr 2007-12-20 15:34:08 UTC (rev 17339)
+++ labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/LogicalTopTier.dslr 2007-12-20 15:34:57 UTC (rev 17340)
@@ -57,6 +57,7 @@
mr: MaxRadius()
not Job(jobId == mr.jobId)
then
+ System.out.println("Clobber MR");
retract(mr);
end
Modified: labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/Queries.drl
===================================================================
--- labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/Queries.drl 2007-12-20 15:34:08 UTC (rev 17339)
+++ labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/Queries.drl 2007-12-20 15:34:57 UTC (rev 17340)
@@ -23,10 +23,30 @@
e: TopWorkers(jobId == s)
end
+query getJobExclusion (String s)
+ e: JobExclusion(jobId == s)
+end
+
query getWorkerInfo(String id, WorkerInfo.Type t)
wi: WorkerInfo(workerId == id, type == t)
end
-query getInfo(String wId, String jId, Info.Type t)
- i: Info(workerId == wId, jobId == jId, type == t)
+query getInfo(String jId, String wId, Info.Type t)
+ i: Info(jobId == jId, workerId == wId, type == t)
end
+
+query getExclusion(String jId, String wId, Exclusion.Type t)
+ i: Exclusion(jobId == jId, workerId == wId, type == t)
+end
+
+query getScoreComponent(String jId, String wId, ScoreComponent.Type t)
+ i: ScoreComponent(jobId == jId, workerId == wId, type == t)
+end
+
+query getScoreComponents(String wId, String jId)
+ s: ScoreComponent(workerId == wId, jobId == jId)
+end
+
+query getScore(String wId, String jId)
+ s: Score(workerId == wId, jobId == jId)
+end
Modified: labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/ScoreManagement.dslr
===================================================================
--- labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/ScoreManagement.dslr 2007-12-20 15:34:08 UTC (rev 17339)
+++ labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/ScoreManagement.dslr 2007-12-20 15:34:57 UTC (rev 17340)
@@ -31,9 +31,9 @@
j : Job()
job dispatchable
w: Worker()
+ #Don't score workers that aren't eligible
+ no exclusions
within range
- #Don't score workers that aren't eligible
- not Exclusion(workerId == w.workerId, jobId == j.jobId)
then
ScoreComponent sc = new ScoreComponent(j, w, ScoreComponent.Type.DEFAULT, 0D);
insertLogical(sc);
@@ -46,9 +46,8 @@
j : Job()
job dispatchable
w: Worker()
+ no exclusions
within range
- #Don't score workers that aren't eligible
- not Exclusion(workerId == w.workerId, jobId == j.jobId)
totScore : Double()
from accumulate( ScoreComponent( workerId == w.workerId, jobId == j.jobId, sc:contribution ),
sum(sc) )
@@ -81,12 +80,11 @@
salience -200
when
tw: TopWorkers(size < DispatchParameters.MIN_SCORED_WORKERS)
- #Ensure no infinite loop? Doesn't propogation cease on its own?
mw: MaxRadius(jobId == tw.jobId, maxRadius < 4000)
#TODO: Ensure sufficient minimum score of Top N vehicles here
then
- mw.setMaxRadius(mw.getMaxRadius() + DispatchParameters.INCREMENTAL_SEARCH_RADIUS);
- insert(mw);
+ mw.setMaxRadius(mw.getMaxRadius() * DispatchParameters.INCREMENTAL_SEARCH_RADIUS_MULTIPLIER);
+ update(mw);
end
Modified: labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/Scoring.dslr
===================================================================
--- labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/Scoring.dslr 2007-12-20 15:34:08 UTC (rev 17339)
+++ labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/Scoring.dslr 2007-12-20 15:34:57 UTC (rev 17340)
@@ -28,6 +28,7 @@
j: Job()
job dispatchable
w: Worker(vehicleSize == VehicleSize.EXTRA_LARGE)
+ no exclusions
within range
i: DecimalInfo(workerId == w.workerId, jobId == j.jobId,
type == Info.Type.DISTANCE_TO_JOB_MILES, dist: value >= 100)
@@ -45,7 +46,7 @@
j: Job()
job dispatchable
w: Worker(vehicleSize != VehicleSize.EXTRA_LARGE)
- within range
+ no exclusions
i: DecimalInfo(workerId == w.workerId, jobId == j.jobId,
type == Info.Type.DISTANCE_TO_JOB_MILES, dist: value >= 100)
then
@@ -62,9 +63,9 @@
j : Job
job dispatchable
w : Worker()
- within range
+ no exclusions
i: DecimalInfo(jobId == j.jobId, workerId == w.workerId,
- type == Info.Type.MINUTES_LATE_TO_JOB, minutesLate: value >= 0)
+ type == Info.Type.MINUTES_LATE_TO_JOB, minutesLate: value > 0)
then
ScoreComponent sc = new ScoreComponent(j,
w,
Modified: labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/dispatch.dsl
===================================================================
--- labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/dispatch.dsl 2007-12-20 15:34:08 UTC (rev 17339)
+++ labs/jbossrules/contrib/benchmarks/src/rules/benchmarks/dispatch/dispatch.dsl 2007-12-20 15:34:57 UTC (rev 17340)
@@ -3,3 +3,4 @@
[condition][]time matters=ds: DispatchState()
[condition][]job dispatchable=not JobExclusion(jobId == j.jobId)
[condition][]within range=dist_mr: DecimalInfo(jobId == j.jobId, workerId == w.workerId, type == Info.Type.DISTANCE_TO_JOB_MILES);MaxRadius(jobId == j.jobId, maxRadius >= dist_mr.value)
+[condition][]no exclusions=not Exclusion(workerId == w.workerId, jobId == j.jobId)
More information about the jboss-svn-commits
mailing list