class_docstr: Managing autoscaling policies and the lifecycle of the scaling function calls.
class_docstr_tok: ["Managing","autoscaling","policies","and","the","lifecycle","of","the","scaling","function","calls","."]
docstr: Interface with the autoscaling policy to get a decision to scale replicas.
  
  After the decision number of replicas is returned by the policy, it is then
  bounded by the bounds min and max adjusted by the target capacity and returned.
  If `_skip_bound_check` is True, then the bounds are not applied.
docstr_tok: ["Interface","with","the","autoscaling","policy","to","get","a","decision","to","scale","replicas",".","After","the","decision","number","of","replicas","is","returned","by","the","policy",",","it","is","then","bounded","by","the","bounds","min","and","max","adjusted","by","the","target","capacity","and","returned",".","If","`","_skip_bound_check","`","is","True",",","then","the","bounds","are","not","applied","."]
code: def get_decision_num_replicas(
      self,
      curr_target_num_replicas: int,
      current_num_ongoing_requests: List[float],
      current_handle_queued_queries: float,
      target_capacity: Optional[float] = None,
      target_capacity_direction: Optional[
          TargetCapacityDirection
      ] = None,
      _skip_bound_check: bool = False,
  ) -> Optional[int]:
      """Interface with the autoscaling policy to get a decision to scale replicas.
  
      After the decision number of replicas is returned by the policy, it is then
      bounded by the bounds min and max adjusted by the target capacity and returned.
      If `_skip_bound_check` is True, then the bounds are not applied.
      """
      capacity_adjusted_min_replicas = self.get_current_lower_bound(
          target_capacity,
          target_capacity_direction,
      )
      capacity_adjusted_max_replicas = (
          get_capacity_adjusted_num_replicas(
              self.config.max_replicas,
              target_capacity,
          )
      )
      decision_num_replicas = self.policy(
          curr_target_num_replicas=curr_target_num_replicas,
          current_num_ongoing_requests=current_num_ongoing_requests,
          current_handle_queued_queries=current_handle_queued_queries,
          config=self.config,
          capacity_adjusted_min_replicas=capacity_adjusted_min_replicas,
          capacity_adjusted_max_replicas=capacity_adjusted_max_replicas,
          policy_state=self.policy_state,
      )
  
      if _skip_bound_check:
          return decision_num_replicas
  
      return self.apply_bounds(
          curr_target_num_replicas=decision_num_replicas,
          target_capacity=target_capacity,
          target_capacity_direction=target_capacity_direction,
      )
  
file_path: ray/python/ray/serve/_private/autoscaling_policy.py
imports: import logging
  from typing import List, Optional
  from ray.serve._private.common import TargetCapacityDirection
  from ray.serve._private.constants import SERVE_LOGGER_NAME
  from ray.serve._private.utils import get_capacity_adjusted_num_replicas
  from ray.serve.config import AutoscalingConfig
label_desc: Use image node_id 4 for calling the AutoscalingPolicyManager obj's underlying member method code with example usage: obj.get_decision_num_replicas(curr_target_num_replicas, current_num_ongoing_requests, current_handle_queued_queries, target_capacity, target_capacity_direction, _skip_bound_check) and returns: self, decision_num_replicas