class_docstr: Basic cost model. Change it as we add more cost based rules
class_docstr_tok: ["Basic","cost","model",".","Change","it","as","we","add","more","cost","based","rules"]
docstr: Return the cost of the group expression.
docstr_tok: ["Return","the","cost","of","the","group","expression","."]
code: def calculate_cost(self, gexpr: GroupExpression):
      """
      Return the cost of the group expression.
      """
  
      @singledispatch
      def cost(opr: AbstractPlan):
          return 1.0
  
      @cost.register(NestedLoopJoinPlan)
      def cost_nested_loop_join_build_plan(opr: NestedLoopJoinPlan):
          return 1.0
  
      @cost.register(HashJoinBuildPlan)
      def cost_hash_join_build_plan(opr: HashJoinBuildPlan):
          return 1.0
  
      @cost.register(HashJoinProbePlan)
      def cost_hash_join_probe_plan(opr: HashJoinProbePlan):
          return 1.0
  
      @cost.register(SeqScanPlan)
      def cost_seq_scan(opr: SeqScanPlan):
          return 1.0
  
      @cost.register(ApplyAndMergePlan)
      def cost_apply_and_merge(opr: ApplyAndMergePlan):
          if opr.func_expr.has_cache():
              return 0
          return 1
  
      return cost(gexpr.opr)
  
file_path: evadb/evadb/optimizer/cost_model.py
imports: from functools import singledispatch
  from evadb.optimizer.group_expression import GroupExpression
  from evadb.plan_nodes.abstract_plan import AbstractPlan
  from evadb.plan_nodes.apply_and_merge_plan import ApplyAndMergePlan
  from evadb.plan_nodes.hash_join_build_plan import HashJoinBuildPlan
  from evadb.plan_nodes.hash_join_probe_plan import HashJoinProbePlan
  from evadb.plan_nodes.nested_loop_join_plan import NestedLoopJoinPlan
  from evadb.plan_nodes.seq_scan_plan import SeqScanPlan
label_desc: Use image node_id 2 for calling the CostModel obj's underlying member method code with example usage: obj.calculate_cost(gexpr) and returns: cost, int, int, int, int, int, int, int