[rules-users] SimpleScoreCalculator

André Fróes arfmoraes at gmail.com
Tue Feb 19 10:54:29 EST 2013


Hello, since i'm not moving a step from where I am at dsl rule, I'm trying
to do it with SimpleScoreCalculator, but the same is happening.

------------
public HardAndSoftScore calculateScore(Distributor distributor) {
int hardScore = 0;
int softScore = 0;
 for (Engineer e : distributor.getEngineerList()){
long skill = e.getSkillEngineerList().get(0).getSkill().getId();
int requiredWorktime = 0;
long requiredSkill = 0l;
 for (WorkOrder o : distributor.getWorkOrderList()){
if (e.equals(o.getEngineer())){
requiredWorktime += o.getRequiredWorktime();
requiredSkill = o.getRequiredSkills().get(0).getSkill().getId();
}
}
 int engineerAvailableTime = e.getWorktime() - requiredWorktime;
if (engineerAvailableTime < 0 ){
hardScore += engineerAvailableTime;
}
 if (requiredSkill == skill){
softScore += requiredSkill;
}
}
return DefaultHardAndSoftScore.valueOf(hardScore, softScore);
}
------------

wouldn't that have to fit since i'm comparing the 1st attribute of each
skill list from engineers and workorders? And how can I weight which
engineer would be better to a determined workorder if the workorder have
more skills and so does the engineer?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130219/f8654e6d/attachment.html 


More information about the rules-users mailing list