In order to simplify the process of creating a control flow loop that uses the Map module, VisTrails has a Control Flow Assistant (CFA). To use the CFA, you must:
Note: All existing connections to input and output ports selected in steps 4 and 5 will be removed.
By default, the List inputs will be used sequentially, one from each List, which requires that all List inputs be the same length. As another option, the Group created by the CFA has a boolean ‘UseCartesianProduct’ parameter. If this parameter is set to ‘true’ then the cartesian product of all of the input Lists will be used as the input for the Map. Use caution when using this parameter, as the number of inputs can grow very rapidly with just a few List inputs.
There are several ways to handle the output List. One option would be to send the output List to a StandardOutput module to display its contents. Another option is to simply ignore the output List, in the case where you just want part of the workflow to execute multiple times using different inputs. For example, if the mapped portion of the workflow contains a VTKCell, and you just want to generate a new VTKCell for each input, you should select the ‘self’ port of the VTKCell module when choosing the output port in the CFA, and then ignore the output List. For more specialized handling of the output List, you may wish to create a PythonSource module.
For advanced users, the default behavior, or cartesian product behavior may not be sufficient for your needs. If this is the case, the ‘UserDefinedInputList’ parameter allows you to manually specify the input list. If this parameter is defined, it will override any input lists already defined or connected. The format for this user-provided input list must be a list of lists of tuples. Each inner list represents a single loop execution, and contains tuples (or single values for functions taking only one argument) representing the arguments for each input function to be used in that loop execution. The order of the argument tuples in the inner lists should match the order in which the functions appear on the module generated by the CFA.
For example, if the loop has two input functions defined, in order, as SetXY(x, y) and SetZ(z), and we want two executions of the loop, the input list would be: [[(x1, y1), z1], [(x2, y2), z2]]
One useful purpose for the CFA is to provide a version-based approach to parameter exploration. To create a parameter exploration for a workflow, you could simply select all modules in the workflow, making sure the ports for the desired parameters are enabled, then launch the CFA and select the ports of the parameters you wish to explore. By providing a list for each parameter, you can create a parameter exploration that directly uses the version tree.
Try it Now!
Processing a List of values with PythonCalc:
Try it Now!
Performing a Parameter Exploration: