drools-planner

Matching a list (of tags) with another and detecting presence of common elements

给你一囗甜甜゛ 提交于 2019-12-03 18:14:14
问题 My requirement is to match tags. In the example, this particular HourConstraint checks the TeacherHour assigned to Hour(23) . Specifically, it checks TeacherHour.attributes["tags"] for the values ["asst_ct","teacher_john_smith"] and detects atleast one match , two in this case (both "asst_ct" and "teacher_john_smith" ) . TeacherHour: id: 47 assigned_hour: Null attributes:Map<List<String>> "tags":["asst_ct","no_strenuous_duties","kinda_boring","teacher_john_smith"] "another_attribute":[...]

Confused about naming of JavaBean properties, with respect to getters and setters

情到浓时终转凉″ 提交于 2019-11-29 11:01:01
I am making an application that uses Drools planner. The @ValueRangeFromSolutionProperty is supposed to refer to a property from another class ( NQueens in this case). From the JavaDocs for @ValueRangeFromSolutionProperty : propertyName The property name of which exists a getter on the Solution that returns a Collection. But I noticed an inconsistency : the annotator uses the property rowList from NQueens . But rowList (as opposed to RowList ) is a private variable (see snippets below). If it were supposed to infer a property by introspection (from it's getter and setter methods), shouldnt it

Implementing methods having raw types in Scala

丶灬走出姿态 提交于 2019-11-28 00:07:42
I have a problem in using Drools Planner (written in Java) in Scala. One of interfaces in Drools planner is declared as: public interface Score<S extends Score> extends Comparable<S> However another interface uses 'Score' as a raw type: public interface Solution { Score getScore(); Then I'd like to implement this interface in Scala: class MySolution extends Solution { def getScore: Score = ... And I get a compilation error: Scala compiler disallows writing just 'def getScore: Score'. When I try adding 'Score[_]' or 'Score[whatever]' compiler complains about type incompatibility. What should I

Implementing methods having raw types in Scala

馋奶兔 提交于 2019-11-26 23:22:53
问题 I have a problem in using Drools Planner (written in Java) in Scala. One of interfaces in Drools planner is declared as: public interface Score<S extends Score> extends Comparable<S> However another interface uses 'Score' as a raw type: public interface Solution { Score getScore(); Then I'd like to implement this interface in Scala: class MySolution extends Solution { def getScore: Score = ... And I get a compilation error: Scala compiler disallows writing just 'def getScore: Score'. When I