我制定了 optaplanner 规则(见下文)。
//in expressway long tunnel(over 1km), equipment interval(400m)
rule "lcs_transport_tunnel_expway"
when
$road : RoadVO(roadCtgry=="EXPWAY")
$t1 : Transport(transportCode=="TUNNEL", $direction:direction,
Math.abs(mileageBegin-mileageEnd)>1000,
$mileageBegin:mileageBegin, $mileageEnd:mileageEnd )
$e0 : ItsEquipment(itsClass=="LCS", direction==$direction,
mileage >$mileageBegin && <$mileageEnd, $id:id, $mileage:mileage)
$e1 : ItsEquipment(itsClass== "LCS", direction==$direction, id==$id+1,
mileage==$mileage+400 )
then
scoreHolder.addSoftConstraintMatch(kcontext, 1000);
end
optaplanner 在解决问题时,$e1 is not properly chosen.
问题是什么?
请告诉我。谢谢。