[Optaplanner] No-arg constructor for BendableScoreDefinition
by jonathan.labin
Is there an example that uses BendableScore?
I'm trying to convert my app from using HardSoftScore to BendableScore and
I've run into my first issue:
Changing from:
@XStreamConverter(value = XStreamScoreConverter.class, types =
{HardSoftLongScoreDefinition.class})
to
@XStreamConverter(value = XStreamScoreConverter.class, types =
{BendableScoreDefinition.class})
throws:
Caused by: java.lang.IllegalArgumentException: The scoreDefinitionClass
(class
org.optaplanner.core.impl.score.buildin.bendable.BendableScoreDefinition)
does not have a public no-arg constructor.
The answer to this issue would be helpful but I'll probably hit other bumps
along the way. Does anyone have an example that uses BendableScore?
Thanks,
Jon
--
View this message in context: http://drools.46999.n3.nabble.com/Optaplanner-No-arg-constructor-for-Bend...
Sent from the Drools: User forum mailing list archive at Nabble.com.
9 years, 10 months
Shared Facts across nodes
by mauro
Hello all,
After searching the web and Drools forums for a couple of days, I couldn't
find a solution to the problem I've got to solve. Anyway, if there's a
thread pointing at the same problem, I apologize and please, let me know
where it is.
My current scenario involves a Drools cluster and demands high availability
and scalability of nodes.
I have to provide a pool of rules (Guvnor should easily handle that) and a
set of servers to process facts against those rules.
This is where I'm stuck at.
I need to make sure all generated facts are shared across drools servers at
the time they get into the cluster.
In other words, what I need is a kind of shared (and persistent) session,
and this session should contain unique facts, so the nodes don't waste time
processing what has already been processed by another node. Also, session
response time is critical.
Since I'm new to the Drools world, maybe I'm missing some important aspects
here, however, as far as I understood, Drools should be able to supply my
requirements.
Already read about Drools-Grid (Is it still alive? Being developed?
Reliable?) and JBoss Infinispan. Both seem to help on solving this
requirement, but I'm not sure whether they're the correct tools to attach to
the arch and get to the solution.
Moreover, I have to make sure an instance of Guvnor can share rules with
other instances being queried by the Drools servers.
How can I solve the problems?
Thank you in advance,
Mauro
--
View this message in context: http://drools.46999.n3.nabble.com/Shared-Facts-across-nodes-tp4023210.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
9 years, 10 months
Optaplan6.0.0Beta1:chaining-simpleScore OK, DRL Score corruption
by Paul T
Requirement:Equip to tasks scheduling.Earlier tasks may not exceed a waittime
to latest endtime for each job.
2 JOBs to plan each with 2 identical TASKs with only 1 EQUIPMENT anchor:
J1 comprises T1,T2 and J2 comprises T1,T2.
problem Fact: EQUIPMENT E1
planning Entity: TASK T1|duration=3|waittime=2 and
T2|duration=5|waittime=3
OptaPlan Schedule attempt
-------------------------
anchor(E1:T1J1,T1J2,T2J1,T2J2) - so T1J1 is pos1,T1J2 is pos2 etc :
timings are 3+3+5+5 and respective waittimes are 2,2,3,3
Rule: get latest ending task by JOB and punish if waittime is exceeded
between the tasks for that specific JOB.
J1 latestendtime=11 which is T2J1
J2 latestendtime=16 which is T2J2
Punish if any task endtime for JOB exceeds waittime (so for J1:
T2J1-T1J1=(11-6-2)*-1 = -3 (SOFT)
- I believe that the score function remembers J1,T2J1 in position 3 and
T1J1 in position 1 with SOFT score -3
OptaPlan Schedule attempt
-------------------------
anchor(E1:T1J1,T2J2,T2J1,T1J2) - so T1J1 is pos1,T2J2 is pos2 etc :
timings are 3+5+5+3 and respective waittimes are 2,3,3,2
Rule: get latest ending task by JOB and punish if waittime is exceeded
between JOBs
J1 latestendtime=13 which is T2J1
J2 latestendtime=16 which is T1J2
Punish if any task endtime for JOB exceeds waittime (so for J1:
T2J1-T1J1=(13-6-2)*-1 = -5 (SOFT)
- I believe that the score function remembers J1,T2J1 in position 3 and
T1J1 in position 1 with SOFT score -5
Score corruption seems to occur as the DRL scoring function has 2 identical
set of entities/values but with different score results!
J1,T2J1 in position 3 and T1J1 in position 1 with SOFT score -3
J1,T2J1 in position 3 and T1J1 in position 1 with SOFT score -5
What has happened is that J2 has swapped its tasks around which are not(?)
taken into account for a chaining DRL score function and
hence does not see them as different.
Q?: Am I correct in my assumption that the DRL score function has
insufficient data to compare for my requirement?
Q?: If so any ideas to resolve?
--
View this message in context: http://drools.46999.n3.nabble.com/Optaplan6-0-0Beta1-chaining-simpleScore...
Sent from the Drools: User forum mailing list archive at Nabble.com.
9 years, 10 months
How to write Hibernate query lang(HQL) in .DRL file
by zeeshan
Hi !
According to my requirement I need to fetch and Insert data from database
using Hibernate Query from .DRL file.
I have idea how to execute HQL in Plain Java class but according to my
requirement,I need to fire query to database from .DRL file which I tried
but unable to get output instead I was getting errors.
Can anyone suggest me process to execute Hibernate Query from DRL file
or please provide me some sample code or any link.
Thanks !!
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-write-Hibernate-query-lang-HQL-i...
Sent from the Drools: User forum mailing list archive at Nabble.com.
9 years, 10 months
[Planner]
by Mats Norén
Hi,
I've got a really simple problem that I can't seem to fix. :-)
I'm trying to use a simplified model for a room planning problem.
The planning entity is a Topic and the planning variables are Room and
TimeSlot.
A Person is tied to a Topic as a moderator.
Each Person can have multiple Topics as an interest.
The hard constraints are that a Person cannot be moderator in two Topics at
the same TimeSlot and that there cannot be multiple Topics in the same Room
at the same TimeSlot.
rule "conflictingModeratorInSameTimeslot"
when
$leftTopic : Topic($leftId : id, $leftTimeslot : timeSlot, timeSlot
!= null, $leftModerator: moderator)
$rightTopic : Topic(timeSlot == $leftTimeslot, moderator ==
$leftModerator, id > $leftId)
then
scoreHolder.addHardConstraintMatch(kcontext, -1);
end
rule "multipleTopicsInSameRoomAndTimeslot"
when
$leftTopic : Topic($leftId : id, $leftTimeslot : timeSlot, timeSlot
!= null, $leftRoom: room)
$rightTopic : Topic(timeSlot == $leftTimeslot, room == $leftRoom,
id > $leftId)
then
scoreHolder.addHardConstraintMatch(kcontext, -1);
end
The soft constraint that I have a problem with is that a Person has
multiple Topics as interests and I would like to penalize the Solution with
the number of Topics in the Persons interests collection with the number of
Topics that are allocated at the same TimeSlot.
Any ideas on how to go about this?
Regards,
Mats
9 years, 11 months
KnowledgeAgent to update knowledge base built with Guvnor pkg
by riri
Hello everyone,
I am trying to take advantage of the automatic uploading that the
KnowledgeAgent provides and am using the 5.5.Final Drools version. The
Drools Expert documentation states that one can use an existing knowledge
base to create an agent, and the agent will subscribe to the resources that
it finds (Example 3.26. Using an existing KnowledgeBase).
I am at first creating the knowledge base using a set of .drl files defined
in a change-set file and also a Guvnor url :
http://127.0.0.1:8080/guvnor/org.drools.guvnor.Guvnor/package/<package-name>/LATEST.
I then create the knowledge agent as shown in Example 3.26 of the
documentation. The problem is that if I modify the Guvnor package (add or
remove a rule) and then rerun a stateful knowledge session, the knowledge
base is not updated. I thought that I needed to build the package in Guvnor
every time I modify it but doing so does not solve the problem. Modifying
the rules in the change-set files seems to update the knowledge base.
I start the ResourceChangeScanner and ResourceChangeNotifier and if I call
isMonitorChangeSetEvents() and isScanResources() they return true. And also,
whenever I create a session, I use the getKnowledgeBase() method and am not
caching it somewhere in my program. Should I not be creating the agent with
an existing knowledge base and instead use the applyChangeSet() method? If
so, how would I be able to configure the knowledge base to use
AssertBehaviorOption.EQUALITY?
Thany you very much for any help or tips to point me in the right direction.
Best regards
--
View this message in context: http://drools.46999.n3.nabble.com/KnowledgeAgent-to-update-knowledge-base...
Sent from the Drools: User forum mailing list archive at Nabble.com.
9 years, 11 months