def __init__(self,data,children,meta=None): self.symbol_refs=[] refs=set() for s in children: if isinstance(s,SymbolName): refs.add(s.name) elif isinstance(s,Tree): for s in s.find_data('symbol_name'): refs.add(s.name) self.symbol_refs=list(refs) Tree.__init__(self,data,children,meta=meta)
def __init__(self,data,children,meta=None): self.name=children[0] for c in children: if isinstance(c,Tree) and c.data == 'sense_min': self.sense='min' elif isinstance(c,Tree) and c.data == 'sense_max': self.sense='max' elif isinstance(c,SymbolName): self.obj=c else: logger.warning("Solve definition, dont recognize child") Tree.__init__(self,data,children,meta=meta)
def __init__(self,data,children,meta=None): self.name=children[0] Tree.__init__(self,data,children,meta=meta)
def __init__(self,data,children,meta=None): self.name=children[0] self.equations=children[1:] Tree.__init__(self,data,children,meta=meta)