Skip to content

Commit ee00fb3

Browse files
committed
docs: mixed model CH
1 parent e3dbadc commit ee00fb3

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 entities in a queue.
718+
. Assign the first entity (from that queue) to the best value.
719+
. Repeat until all entities are assigned.
720+
. Put all values in a round-robin queue.
721+
. Assign the best entity to the first value (from that queue).
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+
<queuedEntityPlacer/>
733+
</constructionHeuristic>
734+
<constructionHeuristic>
735+
<queuedValuePlacer>
736+
<valueSelector variableName="variableName"/>
737+
</queuedValuePlacer>
738+
</constructionHeuristic>
739+
----
740+
741+
Advanced configuration for a single entity class with a list variable and a single basic variable:
742+
743+
[source,xml,options="nowrap"]
744+
----
745+
<!-- Basic Variable -->
746+
<constructionHeuristic>
747+
<queuedEntityPlacer>
748+
<entitySelector id="placerEntitySelector">
749+
<cacheType>PHASE</cacheType>
750+
<selectionOrder>SORTED</selectionOrder>
751+
<sorterManner>DECREASING_DIFFICULTY</sorterManner>
752+
</entitySelector>
753+
<changeMoveSelector>
754+
<entitySelector mimicSelectorRef="placerEntitySelector"/>
755+
<valueSelector>
756+
<cacheType>PHASE</cacheType>
757+
<selectionOrder>SORTED</selectionOrder>
758+
<sorterManner>INCREASING_STRENGTH</sorterManner>
759+
</valueSelector>
760+
</changeMoveSelector>
761+
</queuedEntityPlacer>
762+
</constructionHeuristic>
763+
<!-- List Variable -->
764+
<constructionHeuristic>
765+
<queuedValuePlacer>
766+
<valueSelector variableName="variableName">
767+
<cacheType>PHASE</cacheType>
768+
<selectionOrder>SORTED</selectionOrder>
769+
<sorterManner>INCREASING_STRENGTH</sorterManner>
770+
</valueSelector>
771+
</queuedValuePlacer>
772+
</constructionHeuristic>
773+
----
774+
705775
[#scalingConstructionHeuristics]
706776
== Scaling construction heuristics
707777

0 commit comments

Comments
 (0)