Skip to content

Commit d478beb

Browse files
committed
docs: add CH docs
1 parent c551d02 commit d478beb

1 file changed

Lines changed: 69 additions & 0 deletions

File tree

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

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,75 @@ 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+
Allocate To Value From Queue works 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, and the best entity from the second queue to the first value (best combination from both allocations).
721+
. Repeat until all entities are assigned.
722+
723+
[#mixedModelConfiguration]
724+
=== Configuration
725+
726+
Simple configuration:
727+
728+
[source,xml,options="nowrap"]
729+
----
730+
<constructionHeuristic>
731+
</constructionHeuristic>
732+
----
733+
734+
Advanced configuration for a single entity class with a list variable and a single basic variable:
735+
736+
[source,xml,options="nowrap"]
737+
----
738+
<constructionHeuristic>
739+
<!-- List Variable -->
740+
<queuedValuePlacer>
741+
<valueSelector id="placerValueSelector">
742+
<cacheType>PHASE</cacheType>
743+
<selectionOrder>SORTED</selectionOrder>
744+
<sorterManner>INCREASING_STRENGTH</sorterManner>
745+
</valueSelector>
746+
<changeMoveSelector>
747+
<entitySelector>
748+
<cacheType>PHASE</cacheType>
749+
<selectionOrder>SORTED</selectionOrder>
750+
<sorterManner>DECREASING_DIFFICULTY</sorterManner>
751+
</entitySelector>
752+
<valueSelector mimicSelectorRef="placerValueSelector"/>
753+
</changeMoveSelector>
754+
</queuedValuePlacer>
755+
<!-- Basic Variable -->
756+
<queuedEntityPlacer>
757+
<entitySelector id="placerEntitySelector">
758+
<cacheType>PHASE</cacheType>
759+
<selectionOrder>SORTED</selectionOrder>
760+
<sorterManner>DECREASING_DIFFICULTY</sorterManner>
761+
</entitySelector>
762+
<changeMoveSelector>
763+
<entitySelector mimicSelectorRef="placerEntitySelector"/>
764+
<valueSelector>
765+
<cacheType>PHASE</cacheType>
766+
<selectionOrder>SORTED</selectionOrder>
767+
<sorterManner>INCREASING_STRENGTH</sorterManner>
768+
</valueSelector>
769+
</changeMoveSelector>
770+
</queuedEntityPlacer>
771+
</constructionHeuristic>
772+
----
773+
705774
[#scalingConstructionHeuristics]
706775
== Scaling construction heuristics
707776

0 commit comments

Comments
 (0)