I have an assembly containing a workflow of several components. I am iterating on the components in an optimization. If one of the components has inputs that have not changed, the outputs have not changed either, and I would rather not execute the component. Is there an option that would do this for me?
asked 12 Aug '15, 18:41
The way to handle this is to build a cache into the component. You can use the a tuple of the input values as the key to a dictionary, and a tuple of the outputs as their value. Then before running the code, you first check if the key exists. If it does, pull out the values and use them. If it doesn't then you run.
This method has the added advantage of preventing execution if you have EVER seen those inputs before (even if you've run other cases in between). If you're using any kind of genetic or particle swarm algorithm, this is very likely to occur.
answered 12 Aug '15, 18:47