Open sperka opened 2 years ago
Hi @rodrigokestler
We added these constraints as examples. If your business use-case requires such a thing, you can introduce it to your system. As far as I can imagine, assigning the same driver that already rejected the order can happen if..
In both cases you can maintain a list in the PlanningDelivery
object which drivers were assigned to that delivery item with what status (Accepted, Rejected, etc) and from which provider, or just simply which provider's which driver rejected the order. (I'd say in a prod environment you'd be maintaining already all the events that happen to an order, so you'd have this information already). Then hasDriverCancelledThisOrderBefore
is a simple lookup.
Make sure that the information is accessible in-memory (i.e: pull the order data from a DB before kicking off the optimization phase).
Hope this helps!
Hi @sperka Are you planning on implementing penalization for drivers that have rejected orders previously? In other words, penalize driver scores for orders that they have rejected. I see a commented-out code for this, but it is using a class that does not exist