7.1 Running the network from the command line

Problem

Although FlowDesigner can be built and executed, it is annoying to use GUI every time. I want to run the network file using a command line, as well as to change network parameters using command line arguments.

Solution

You can execute the network file as if it is an executable file.

$ ./foo.n

You can give command line argument to change the behavior. Open the network file using FlowDesigner , and edit it as follows

  1. In the MAIN subnetwork, open the node property window to which you want to give a command line argument.

  2. Designate the Type of variable for which an argument is substituted for in subnet_param and enter "ARG?" as Value (the index of the argument should be entered in ?. If this is the first argument, enter "ARG1")

Note that you can give the command line argument only to the nodes in the MAIN subnetwork. Two steps are required to give command line arguments to other nodes First, set the Type of the parameter as subnet_param so that you can see the parameter in the MAIN network.

Then, set the command line argument in the MAIN subnetwork. Then, you can run it as if it were an ordinal executable. For example,

$ ./foo.n 0.5 0.9

Then, ARG1 is set to 0.5 and ARG2 to 0.9, followed by the execution of foo.n.

Discussion

The arguments are interpreted as string type by default. If utilize different types, such as int and float types, designate them as “int ARG1”, “float ARG1”. The current version of FlowDesigner cannot accept command line arguments with Object type such as Vector<int> using this method.

See also

None.