How to allocate liquid into different boxes ?

34 views
Skip to first unread message

Shi Alexander

unread,
Aug 12, 2023, 11:43:30 PM8/12/23
to OptaPlanner development
Hi,

There is a modeling problem: assuming that there are several liquids of different colors waiting to be allocated to several rows of small boxes (the same length and width, but variable height), each row of boxes can only accept liquids of a specific color, and the heights of the boxes provided by each row are different. If we model according to the idea of TaskAssigning in the case, we will need a long box (similar to the duration in the case) to hold the liquid, and due to the limitations of the left and right boundaries, the long box will often exceed the boundary, which does not meet the Practical requirements, because there is no hard requirement that the liquid needs to be packed in a long box, on the contrary, it can be divided into several small boxes.

Please see below drafts for better understanding:
企业微信截图_20230813111014.png
企业微信截图_20230813111035.png
企业微信截图_16918978896884.png

Now I want to plan the small boxes (ProblemFact) into the row (PlanningVariable), but the sizes of these small boxes will change due to the different liquids and rows, which is contrary to the immutable specification of ProblemFact.

Do you have any better suggestions? Thanks in advance.

Shi Alexander

unread,
Aug 13, 2023, 9:07:51 PM8/13/23
to OptaPlanner development
Alternatively, is there a way to have the row waiting to be scheduled execute the planning from the remaining liquid only?

If I can select which fact to be set to PlanningVariable, that will be very helpful.

Anna Dupliak

unread,
Aug 17, 2023, 5:41:39 AM8/17/23
to optapla...@googlegroups.com
Hello Shi,

One of the ways to fit the boxes with the different sizes could be creating a domain model for Rows and Liquids with unified capacity. Lets say that the capacity of 1 box is 1. Then Rows will have some preset capacity and it will be a problem fact and Liquids will have some capacity as well and the row instance that they belong to so it would be a planning variable. Then in ConstraintProvider you can group liquids by rows and get the sum assigned to its liquids capacity, checking that it is not over the limits.




--
You received this message because you are subscribed to the Google Groups "OptaPlanner development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to optaplanner-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/optaplanner-dev/2147749a-d5c6-4ba0-901d-f682b49340dcn%40googlegroups.com.


--

Dupliak Anna

She /Her /Hers

QE, Business Automation

Red Hat

adup...@redhat.com    

 +42-0773-016991




Reply all
Reply to author
Forward
0 new messages