class_docstr: Reward scheme for the 2D cutting env penalizing raw piece usage.
  
  :param reward_scale: Reward scaling factor.
class_docstr_tok: ["Reward","scheme","for","the","2D","cutting","env","penalizing","raw","piece","usage",".",":","param","reward_scale",":","Reward","scaling","factor","."]
docstr: Summarize reward based on the orders and pieces to cut, and return it as a scalar.
  
  :param maze_state: Not used by this reward aggregator.
  :return: the summarized scalar reward.
docstr_tok: ["Summarize","reward","based","on","the","orders","and","pieces","to","cut",",","and","return","it","as","a","scalar",".",":","param","maze_state",":","Not","used","by","this","reward","aggregator",".",":","return",":","the","summarized","scalar","reward","."]
code: def summarize_reward(
      self, maze_state: Optional[MazeStateType] = None
  ) -> float:
      """
      Summarize reward based on the orders and pieces to cut, and return it as a scalar.
  
      :param maze_state: Not used by this reward aggregator.
      :return: the summarized scalar reward.
      """
  
      # iterate replenishment events and assign reward accordingly
      reward = 0.0
      for _ in self.query_events(InventoryEvents.piece_replenished):
          reward -= 1.0
  
      # rescale reward with provided factor
      reward *= self.reward_scale
  
      return reward
  
file_path: maze/docs/source/environment_customization/code_snippets/custom_reward.py
imports: from typing import List, Optional
  from maze.core.annotations import override
  from maze.core.env.maze_state import MazeStateType
  from maze.core.events.pubsub import Subscriber
  from maze_envs.logistics.cutting_2d.env.events import InventoryEvents
  from maze.core.env.reward import RewardAggregatorInterface
label_desc: Use image node_id 3 for calling the RawPieceUsageRewardAggregator obj's underlying member method code with example usage: obj.summarize_reward(maze_state) and returns: reward