class_docstr: KPIs for 2D cutting environment.
  The following KPIs are available: Raw pieces used per step
docstr: Calculates the KPIs at the end of episode.
docstr_tok: ["Calculates","the","KPIs","at","the","end","of","episode","."]
code: def calculate_kpis(
      self,
      episode_event_log: EpisodeEventLog,
      last_maze_state: MazeStateType,
  ) -> Dict[str, float]:
      """Calculates the KPIs at the end of episode."""
  
      # get overall step count of episode
      step_count = len(episode_event_log.step_event_logs)
      # count raw inventory piece replenishment events
      raw_piece_usage = 0
      for _ in episode_event_log.query_events(
          InventoryEvents.piece_replenished
      ):
          raw_piece_usage += 1
      # compute step normalized raw piece usage
      return {"raw_piece_usage_per_step": raw_piece_usage / step_count}
  
file_path: maze/tutorials/tutorial_maze_env/part06_struct_env/env/kpi_calculator.py
imports: from typing import Dict
  from maze.core.env.maze_state import MazeStateType
  from maze.core.log_events.kpi_calculator import KpiCalculator
  from maze.core.log_events.episode_event_log import EpisodeEventLog
  from .events import InventoryEvents
label_desc: Use image node_id 1 for calling the Cutting2dKpiCalculator obj's underlying member method code with example usage: obj.calculate_kpis(episode_event_log, last_maze_state) and returns: dict