Replies: 1 comment 1 reply
-
Hello @luxaritas, Problems with multiple variables are generally more difficult to solve with Timefold Solver. They require non-trivial configuration, and sometimes produce optimization challenges for the solver. Preferrably, they should be avoided. To that end, I do not understand why the Configuration needs to be an entity. Typically, in problems with just basic planning variables, we do not assign entities to other entities. If you make your configuration a planning fact and provide a range of suitable Configurations, many of your problems will go away. Including some which you may not know that you have yet. :-) This would be most similar to your approach 1, but you don't need the ID at all. You can just return a list of configurations as a value range, and the solver will use those directly. (As a side note: There should be no problem with one entity being assigned to multiple variables. List variable doesn't allow it, because the semantics there are that all values need to be assigned exactly once. But basic variable doesn't have this restriction.) |
Beta Was this translation helpful? Give feedback.
-
I have a problem where I have the following situation:
I'm allocating a set of jobs and optimizing the resources requested for each job. However, I want to limit the number of distinct resource configurations. However in the above, a configuration cannot be assigned to more than one job (as far as I know, timefold does not allow for planning entities to be shared/reused/assigned to multiple planning variables). I can imagine doing this a couple ways:
configuration: Annotated[Configuration, PlanningVariable]
, assign each configuration an ID and useconfiguration: Annotated[int, PlanningVariable]
such that it chooses an ID. This seems hacky.Any recommendations for how best to approach this? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions