[rules-users] Optaplan6.0.0Beta1:chaining-simpleScore OK, DRL Score corruption

Geoffrey De Smet ge0ffrey.spam at gmail.com
Fri Apr 19 10:01:55 EDT 2013


Ok, this is starting to look like a genuine bug in drools/optaplanner.
Would it be possible to get a reproducer of this to me?

Easy way:
Zip up (part of) your project, attach it to jira issue for optaplanner
   http://issues.jboss.org/browse/PLANNER
and include detailed instructions how to reproduce it (e.g. which 
main(String[]) to run, which working dir, ...).
Try out your own instructions first pls :)

Preferred way:
Create a public unit test to reproduce it (if possible).

General hints:
The smaller the dataset to reproduce, the better.
The less steps/moves to reproduce, the better.
The less rules active to reproduce, the better.

I 'll isolate the bug from that reproducer, so Mario can fix it.

On 19-04-13 15:27, Paul T wrote:
> Hi Geoffrey - thanks for the prompt reply.
>
> Installed the latest OptaPlanner snapshot but did not resolve the error - no
> change.
> I have played around and made some incremental improvements and although I
> can still replicate the error I described earlier the single constraint
> match error appears easier to debug with this test data.
>
> SimpleScore still works fine and comes up with best answer SOFT -2. DRL
> score corruption (only 1 rule) occurs in local search - gets through
> FIRST_FIT heuristics OK.
> I am still using 4 Plan entities,1 equipment(anchor) to schedule.
> Equip idNo:44 fryer1
> Plan  idNo:58 T1 fryer fry chips duration : 3 stand: 1
> Plan  idNo:61 T1 fryer fry snitzel duration: 7 stand: 2
> Plan  idNo:64 T2 fryer fry chips duration : 3 stand: 1
> Plan  idNo:67 T2 fryer fry snitzel duration: 7 stand: 2
> Table idNo:41 T1
> Table idNo:42 T2
>
>
> Exception in thread "main" java.lang.IllegalStateException: Score
> corruption: the workingScore (0hard/0medium/-8soft) is not the
> uncorruptedScore (0hard/0medium/-12soft):
>    The corrupted scoreDirector has no ConstraintMatch(s) which are in excess.
>    The corrupted scoreDirector has 1 ConstraintMatch(s) which are missing:
>      com.umple.solver/standtime vs
> maxendtime/level2/[org.drools.core.reteoo.InitialFactImpl at 4dde85f0,
> [Table-41],
> 	fryer1 44 T1	POS:4 Plan: id 58 fry chips,
> 	fryer1 44 T1	POS:2 Plan: id 61 fry snitzel]=-4
>
> rule "standtime vs maxendtime"
> 	salience 20
> 	when
> 		not Plan(previousItemTaskorEquip== null) 						// forces all plans to be
> initialised
> 		$table : Table(id!=null,$tableName : name)						
>                 $latestplan : Plan(previousItemTaskorEquip!= null,tableName
> ==$tableName,
> 				 	$maxend : getEquipEndTime(),$maxid : id,$maxstandtime :
> taskSeqStandTime
> 				 	)
> 		
> // NB working - selects correct latestplan  - strange not all the
> latestplans used in heuristics - but are used in local search 		 	
>   		not Plan(previousItemTaskorEquip != null,tableName
> ==$tableName,getEquipEndTime() > $maxend)
>
> // check all plans vs latestplan
> 	  	$plan : Plan(previousItemTaskorEquip!= null,id != null,equip!=null,
>      			 	tableName ==$tableName,getEquipEndTime()<$maxend,id != $maxid,
>      			 	$equip :equip,$endtime: getEquipEndTime(),$standtime :
> taskSeqStandTime,$id : id)
>
>      		eval ($endtime+$standtime-$maxend<0)
>
> 	then
> 	       scoreHolder.addSoftConstraintMatch(kcontext,
> $endtime+$standtime-$maxend);
> end
>
> The part of xml config file which is most likely relevant:
> <localSearch>
>          <unionMoveSelector>
>            <changeMoveSelector>
>            </changeMoveSelector>
>             <swapMoveSelector>
>             </swapMoveSelector>
>          </unionMoveSelector>
>      <acceptor>
>        <planningEntityTabuSize>6</planningEntityTabuSize>
>      </acceptor>
>      <forager>
>        <minimalAcceptedSelection>2000</minimalAcceptedSelection>
>      </forager>
>    </localSearch>
>
> If the Rule looks OK, I will manually step through the trace as it is doable
> but am not sure how to do so or what to look for.
>
> Thanks Paul
>
>
>
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Optaplan6-0-0Beta1-chaining-simpleScore-OK-DRL-Score-corruption-tp4023365p4023454.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



More information about the rules-users mailing list