def all_produced_product_types(self, subject_type):
intrinsic_products = set(prod for subj, prod in self._intrinsics.keys()
if subj == subject_type)
task_products = self._tasks.keys()return intrinsic_products.union(set(task_products))
def gen_rules(self, subject_type, product_type):
// Intrinsics that provide the requested product for the current subject type.
intrinsic_node_factory = self._lookup_intrinsic(product_type, subject_type)
After Change
def all_produced_product_types(self, subject_type):
intrinsic_products = set(prod for subj, prod in self.intrinsics.keys()
if subj == subject_type)
return intrinsic_products.union(set(self.tasks.keys())).union(set(self.singletons.keys()))
def gen_rules(self, subject_type, product_type):
// Singeltons or intrinsics that provide the requested product for the current subject type.
singleton_node_factory = self.singletons.get(product_type)