Interface InsertionOperatorFactory
public interface InsertionOperatorFactory
Factory interface for creating insertion strategies.
This allows registering insertion operators with the algorithm builder without needing to pre-create all dependencies. The factory will be called during algorithm construction when all dependencies are available.
Example usage:
Jsprit.Builder.newInstance(vrp)
.addInsertionOperator(0.7, Insertion.regretFast())
.addInsertionOperator(0.3, Insertion.regret())
.buildAlgorithm();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordContext object containing all dependencies needed to create an insertion strategy. -
Method Summary
Modifier and TypeMethodDescriptioncreate(InsertionOperatorFactory.Context context) Creates an insertion strategy with the given dependencies.default StringgetName()Returns the default name for this operator factory.static InsertionOperatorFactorynamed(String name, InsertionOperatorFactory factory) Creates a named factory wrapper.
-
Method Details
-
create
Creates an insertion strategy with the given dependencies.- Parameters:
context- the context containing all required dependencies- Returns:
- the configured insertion strategy
-
getName
Returns the default name for this operator factory.This name is used in strategy IDs when no explicit name is provided to
addInsertionOperator().- Returns:
- the default name, or null if not specified
-
named
Creates a named factory wrapper.- Parameters:
name- the operator namefactory- the factory to wrap- Returns:
- a factory that returns the given name from
getName()
-