private static Optional<Integer> maxGroupsAllowedDown(ModelElement tuning, int numberOfLeafGroups) {
            var groupsAllowedDownRatio = tuning.childAsDouble("groups-allowed-down-ratio");

            if (groupsAllowedDownRatio != null) {
                if (groupsAllowedDownRatio < 0 || groupsAllowedDownRatio > 1)
                    throw new IllegalArgumentException("groups-allowed-down-ratio must be between 0 and 1, got " + groupsAllowedDownRatio);

                var maxGroupsAllowedDown = Math.max(1, (int) Math.floor(groupsAllowedDownRatio * numberOfLeafGroups));
                return Optional.of(maxGroupsAllowedDown);
            }

            return Optional.empty();
        }
Config generation for parameters for fleet controllers.
config-model/src/main/java/com/yahoo/vespa/model/content/ClusterControllerConfig.java