|
|
@@ -210,13 +210,23 @@ class Fnc:
|
|
|
return self.__class__(self.name, time, eq_time)
|
|
|
|
|
|
def apply(self, eq):
|
|
|
- nargs = self.args[:]
|
|
|
for i, a in enumerate(self.args):
|
|
|
res = a.apply(eq)
|
|
|
- nargs[i] = res
|
|
|
- self.args = nargs
|
|
|
+ self.args[i] = res
|
|
|
return self
|
|
|
|
|
|
+ def contains(self, other):
|
|
|
+ """
|
|
|
+ Checks if the function relies on another value.
|
|
|
+
|
|
|
+ Args:
|
|
|
+ other (str): The name that must be checked.
|
|
|
+ """
|
|
|
+ for arg in self.args:
|
|
|
+ if arg.contains(other):
|
|
|
+ return True
|
|
|
+ return False
|
|
|
+
|
|
|
@staticmethod
|
|
|
def _cross_product_fncs(l1, l2, *lists):
|
|
|
res = []
|
|
|
@@ -438,6 +448,9 @@ class VarFnc(Fnc):
|
|
|
return eq.rhs
|
|
|
return self
|
|
|
|
|
|
+ def contains(self, other):
|
|
|
+ return self.name == other
|
|
|
+
|
|
|
|
|
|
class DelayFnc(Fnc):
|
|
|
def at(self, time):
|