Reference documentation and code samples for the Google Maps Route Optimization V1 Client class FrequencyConstraint.
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
Generated from protobuf message google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint
Namespace
Google \ Maps \ RouteOptimization \ V1 \ BreakRule
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.
getMinBreakDuration
Required. Minimum break duration for this constraint. Nonnegative.
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.
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-09-04 UTC."],[],[],null,["# Google Maps Route Optimization V1 Client - Class FrequencyConstraint (0.4.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.4.1 (latest)](/php/docs/reference/maps-routeoptimization/latest/V1.BreakRule.FrequencyConstraint)\n- [0.4.0](/php/docs/reference/maps-routeoptimization/0.4.0/V1.BreakRule.FrequencyConstraint)\n- [0.3.3](/php/docs/reference/maps-routeoptimization/0.3.3/V1.BreakRule.FrequencyConstraint)\n- [0.2.0](/php/docs/reference/maps-routeoptimization/0.2.0/V1.BreakRule.FrequencyConstraint)\n- [0.1.0](/php/docs/reference/maps-routeoptimization/0.1.0/V1.BreakRule.FrequencyConstraint) \nReference documentation and code samples for the Google Maps Route Optimization V1 Client class FrequencyConstraint.\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 that\nthis can be interpreted as \"Within any sliding time window of 12h, there\nmust be at least one break of at least one hour\", that example would\ntranslate to the following `FrequencyConstraint`: \n\n {\n min_break_duration { seconds: 3600 } # 1 hour.\n\n max_inter_break_duration { seconds: 39600 } # 11 hours (12 - 1 = 11).\n }\n\nThe timing and duration of the breaks in the solution will respect all\nsuch constraints, in addition to the time windows and minimum durations\nalready specified in the `BreakRequest`.\nA `FrequencyConstraint` may in practice apply to non-consecutive breaks.\nFor example, the following schedule honors the \"1h every 12h\" example: \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\n\nGenerated from protobuf message `google.maps.routeoptimization.v1.BreakRule.FrequencyConstraint`\n\nNamespace\n---------\n\nGoogle \\\\ Maps \\\\ RouteOptimization \\\\ V1 \\\\ BreakRule\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getMinBreakDuration\n\nRequired. Minimum break duration for this constraint. Nonnegative.\n\nSee description of `FrequencyConstraint`.\n\n### hasMinBreakDuration\n\n### clearMinBreakDuration\n\n### setMinBreakDuration\n\nRequired. Minimum break duration for this constraint. Nonnegative.\n\nSee description of `FrequencyConstraint`.\n\n### getMaxInterBreakDuration\n\nRequired. Maximum allowed span of any interval of time in the route that\ndoes not include at least partially a break of `duration \u003e=\nmin_break_duration`. Must be positive.\n\n### hasMaxInterBreakDuration\n\n### clearMaxInterBreakDuration\n\n### setMaxInterBreakDuration\n\nRequired. Maximum allowed span of any interval of time in the route that\ndoes not include at least partially a break of `duration \u003e=\nmin_break_duration`. Must be positive."]]