Skip to content

Commit ad2f9e0

Browse files
committed
docs: CH mixed models
1 parent be9ca15 commit ad2f9e0

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

docs/src/modules/ROOT/pages/optimization-algorithms/construction-heuristics.adoc

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,76 @@ is supported too.
702702
For scaling out, see <<scalingConstructionHeuristics,scaling construction heuristics>>.
703703

704704

705+
[#mixedModelConstructionHeuristics]
706+
== Mixed modeling and construction heuristics
707+
708+
If the model includes both xref:using-timefold-solver/modeling-planning-problems.adoc#planningVariable[basic] and xref:using-timefold-solver/modeling-planning-problems#planningListVariable[list] variables,
709+
the default behavior of the construction heuristic is
710+
to use strategies based on the allocation of xref:optimization-algorithms/construction-heuristics.adoc#allocateEntityFromQueue[entities] and xref:optimization-algorithms/construction-heuristics.adoc#allocateToValueFromQueue[values]
711+
for solving all related variables.
712+
713+
=== Algorithm description
714+
715+
The allocations work like this:
716+
717+
. Put all values in a round-robin queue.
718+
. Put all entities in a second queue.
719+
. Combine the moves from the allocation of entity and values.
720+
.. Assign the first entity from the queue to the best value.
721+
.. Assign the best entity from the second queue to the first value.
722+
. Repeat until all entities are assigned.
723+
724+
[#mixedModelConfiguration]
725+
=== Configuration
726+
727+
Simple configuration:
728+
729+
[source,xml,options="nowrap"]
730+
----
731+
<constructionHeuristic>
732+
</constructionHeuristic>
733+
----
734+
735+
Advanced configuration for a single entity class with a list variable and a single basic variable:
736+
737+
[source,xml,options="nowrap"]
738+
----
739+
<constructionHeuristic>
740+
<!-- List Variable -->
741+
<queuedValuePlacer>
742+
<valueSelector id="placerValueSelector">
743+
<cacheType>PHASE</cacheType>
744+
<selectionOrder>SORTED</selectionOrder>
745+
<sorterManner>INCREASING_STRENGTH</sorterManner>
746+
</valueSelector>
747+
<changeMoveSelector>
748+
<entitySelector>
749+
<cacheType>PHASE</cacheType>
750+
<selectionOrder>SORTED</selectionOrder>
751+
<sorterManner>DECREASING_DIFFICULTY</sorterManner>
752+
</entitySelector>
753+
<valueSelector mimicSelectorRef="placerValueSelector"/>
754+
</changeMoveSelector>
755+
</queuedValuePlacer>
756+
<!-- Basic Variable -->
757+
<queuedEntityPlacer>
758+
<entitySelector id="placerEntitySelector">
759+
<cacheType>PHASE</cacheType>
760+
<selectionOrder>SORTED</selectionOrder>
761+
<sorterManner>DECREASING_DIFFICULTY</sorterManner>
762+
</entitySelector>
763+
<changeMoveSelector>
764+
<entitySelector mimicSelectorRef="placerEntitySelector"/>
765+
<valueSelector>
766+
<cacheType>PHASE</cacheType>
767+
<selectionOrder>SORTED</selectionOrder>
768+
<sorterManner>INCREASING_STRENGTH</sorterManner>
769+
</valueSelector>
770+
</changeMoveSelector>
771+
</queuedEntityPlacer>
772+
</constructionHeuristic>
773+
----
774+
705775
[#scalingConstructionHeuristics]
706776
== Scaling construction heuristics
707777

0 commit comments

Comments
 (0)