@@ -194,6 +194,24 @@ def __init__(self):
194194 super ().__init__ (JavaDeepPlanningClone , {})
195195
196196
197+ class ConstraintConfigurationProvider (JavaAnnotation ):
198+ def __init__ (self ):
199+ ensure_init ()
200+ from ai .timefold .solver .core .api .domain .constraintweight import (
201+ ConstraintConfigurationProvider as JavaConstraintConfigurationProvider )
202+ super ().__init__ (JavaConstraintConfigurationProvider , {})
203+
204+
205+ class ConstraintWeight (JavaAnnotation ):
206+ def __init__ (self , constraint_name : str , * , constraint_package : str = None ):
207+ ensure_init ()
208+ from ai .timefold .solver .core .api .domain .constraintweight import ConstraintWeight as JavaConstraintWeight
209+ super ().__init__ (JavaConstraintWeight , {
210+ 'value' : constraint_name ,
211+ 'constraintPackage' : constraint_package
212+ })
213+
214+
197215@JImplements ('ai.timefold.solver.core.api.domain.entity.PinningFilter' , deferred = True )
198216class _PythonPinningFilter :
199217 def __init__ (self , delegate ):
@@ -301,6 +319,15 @@ def __init__(self, a_list):
301319 return out
302320
303321
322+ def constraint_configuration (constraint_configuration_class : Type [Solution_ ]) -> Type [Solution_ ]:
323+ ensure_init ()
324+ from jpyinterpreter import add_class_annotation
325+ from ai .timefold .solver .core .api .domain .constraintweight import (
326+ ConstraintConfiguration as JavaConstraintConfiguration )
327+ out = add_class_annotation (JavaConstraintConfiguration )(constraint_configuration_class )
328+ return out
329+
330+
304331def nearby_distance_meter (distance_function : Callable [[Origin_ , Destination_ ], float ], / ) \
305332 -> Callable [[Origin_ , Destination_ ], float ]:
306333 ensure_init ()
@@ -575,8 +602,9 @@ def wrapper_doChange(self, solution, problem_change_director):
575602 'IndexShadowVariable' , 'AnchorShadowVariable' , 'InverseRelationShadowVariable' ,
576603 'ProblemFactProperty' , 'ProblemFactCollectionProperty' ,
577604 'PlanningEntityProperty' , 'PlanningEntityCollectionProperty' ,
578- 'ValueRangeProvider' , 'DeepPlanningClone' ,
579- 'planning_entity' , 'planning_solution' ,
605+ 'ValueRangeProvider' , 'DeepPlanningClone' , 'ConstraintConfigurationProvider' ,
606+ 'ConstraintWeight' ,
607+ 'planning_entity' , 'planning_solution' , 'constraint_configuration' ,
580608 'nearby_distance_meter' ,
581609 'constraint_provider' , 'easy_score_calculator' , 'incremental_score_calculator' ,
582610 'variable_listener' , 'problem_change' ]
0 commit comments