One may further constrain the frequency and duration of the breaks
specified above, by enforcing a minimum break frequency, such as
"There must be a break of at least 1 hour every 12 hours". Assuming
that this can be interpreted as "Within any sliding time window of
12h, there must be at least one break of at least one hour", that
example would translate to the following FrequencyConstraint:
The timing and duration of the breaks in the solution will respect
all such constraints, in addition to the time windows and minimum
durations already specified in the BreakRequest.
A FrequencyConstraint may in practice apply to non-consecutive
breaks. For example, the following schedule honors the "1h every
12h" example:
::
04:00 vehicle start
.. performing travel and visits ..
09:00 1 hour break
10:00 end of the break
.. performing travel and visits ..
12:00 20-min lunch break
12:20 end of the break
.. performing travel and visits ..
21:00 1 hour break
22:00 end of the break
.. performing travel and visits ..
23:59 vehicle end
Attributes
Name
Description
min_break_duration
google.protobuf.duration_pb2.Duration
Required. Minimum break duration for this constraint.
Nonnegative. See description of FrequencyConstraint.
max_inter_break_duration
google.protobuf.duration_pb2.Duration
Required. Maximum allowed span of any interval of time in
the route that does not include at least partially a break
of duration >= min_break_duration. Must be positive.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Class FrequencyConstraint (1.11.2)\n\nVersion latestkeyboard_arrow_down\n\n- [1.11.2 (latest)](/python/docs/reference/optimization/latest/google.cloud.optimization_v1.types.BreakRule.FrequencyConstraint)\n- [1.11.0](/python/docs/reference/optimization/1.11.0/google.cloud.optimization_v1.types.BreakRule.FrequencyConstraint)\n- [1.10.0](/python/docs/reference/optimization/1.10.0/google.cloud.optimization_v1.types.BreakRule.FrequencyConstraint)\n- [1.9.1](/python/docs/reference/optimization/1.9.1/google.cloud.optimization_v1.types.BreakRule.FrequencyConstraint)\n- [1.8.5](/python/docs/reference/optimization/1.8.5/google.cloud.optimization_v1.types.BreakRule.FrequencyConstraint)\n- [1.7.0](/python/docs/reference/optimization/1.7.0/google.cloud.optimization_v1.types.BreakRule.FrequencyConstraint)\n- [1.6.0](/python/docs/reference/optimization/1.6.0/google.cloud.optimization_v1.types.BreakRule.FrequencyConstraint)\n- [1.5.0](/python/docs/reference/optimization/1.5.0/google.cloud.optimization_v1.types.BreakRule.FrequencyConstraint)\n- [1.4.3](/python/docs/reference/optimization/1.4.3/google.cloud.optimization_v1.types.BreakRule.FrequencyConstraint)\n- [1.3.2](/python/docs/reference/optimization/1.3.2/google.cloud.optimization_v1.types.BreakRule.FrequencyConstraint)\n- [1.2.0](/python/docs/reference/optimization/1.2.0/google.cloud.optimization_v1.types.BreakRule.FrequencyConstraint)\n- [1.1.3](/python/docs/reference/optimization/1.1.3/google.cloud.optimization_v1.types.BreakRule.FrequencyConstraint)\n- [1.0.1](/python/docs/reference/optimization/1.0.1/google.cloud.optimization_v1.types.BreakRule.FrequencyConstraint)\n- [0.1.1](/python/docs/reference/optimization/0.1.1/google.cloud.optimization_v1.types.BreakRule.FrequencyConstraint) \n\n FrequencyConstraint(mapping=None, *, ignore_unknown_fields=False, **kwargs)\n\nOne may further constrain the frequency and duration of the breaks\nspecified above, by enforcing a minimum break frequency, such as\n\"There must be a break of at least 1 hour every 12 hours\". Assuming\nthat this can be interpreted as \"Within any sliding time window of\n12h, there must be at least one break of at least one hour\", that\nexample would translate to the following `FrequencyConstraint`:\n\n::\n\n{\nmin_break_duration { seconds: 3600 } # 1 hour.\nmax_inter_break_duration { seconds: 39600 } # 11 hours (12 - 1 = 11).\n}\n\nThe timing and duration of the breaks in the solution will respect\nall such constraints, in addition to the time windows and minimum\ndurations already specified in the `BreakRequest`.\n\nA `FrequencyConstraint` may in practice apply to non-consecutive\nbreaks. For example, the following schedule honors the \"1h every\n12h\" example:\n\n:: \n\n 04:00 vehicle start\n .. performing travel and visits ..\n 09:00 1 hour break\n 10:00 end of the break\n .. performing travel and visits ..\n 12:00 20-min lunch break\n 12:20 end of the break\n .. performing travel and visits ..\n 21:00 1 hour break\n 22:00 end of the break\n .. performing travel and visits ..\n 23:59 vehicle end"]]