-
Notifications
You must be signed in to change notification settings - Fork 24
Group Files
Group files have the file extension .ikg and describe a model to be run in Ikaros. Group files can be written manually as an XML text file or saved from the web interface.
A group file defines the modules to run and the connections between them.
A minimal group file contains a group without any modules:
<group name="MyModel">
</group>The main group must have a name attributes. Modules are included using the module element.
<group name="MyModel">
<module name="MyConstant" class="Constant" data="1, 2, 3" />
<module name="MyPrint" class="Print" />
</group>Each module can have a number of attributes that are specific to each module but the name and class attributes are always required. The name must be unique within the group and the class declares the actual code for the module. A large number of module classes are available in Ikaros and the documentation for each of them can be found under the directory Source/Modules at GitHub.
Finally, the modules need to be connected using a connection element:
<group name="MyModel">
<module name="MyConstant" class="Constant" data="1, 2, 3" />
<module name="MyPrint" class="Print" />
<connection source="MyConstant.OUTPUT" target="MyPrint.INPUT" />
</group>The added connection will connect the output of the module MyConstant to the input of the module MyPrint. The the output is called OUTPUT and the input is called INPUT, but in general they can have other names. You will need to consult the documentation for the module classes used to know the names of inputs and outputs.
It is also possible to connect modules that are not in the current group using sequences of group and module names, e.g.:
<connection
source = "A.B.C.OUTPUT"
target = "X.Y.Z.INPUT"
/>Each element in the path A.B.C either refers to a subgroup or a parent group.
The path to a module can also be global, starting with a dot:
".A.B.C.OUTPUT"
By default, the complete output is set to the connected input but it is also possible to select only parts of an output to be send to an input. This is controlled by brackets added to the source and target names. For a one-dimensional output or input use the following notation:
<connection
source = "A.OUTPUT[3]"
target = "B.INPUT[7]"
/>This will send element 3 of the output to element 7 of the input. This will also assure that the input of B is at least 8 = (7+1) elements.
You can also specify ranges using a colon:
<connection
source = "A.OUTPUT[3:5]"
target = "B.INPUT[7:9]"
/>This will send elements 3 and 4 from the OUTPUT to 7 and 8 in the input. Note that the final number is not included in the range. If the target range us omitted, the data is send to the first elements of the input. The following two connections are equivalent:
<connection source = "A.OUTPUT[3:5]" target = "B.INPUT[0:2]" /><connection source = "A.OUTPUT[3:5]" target = "B.INPUT" />You can also use an empty bracket to copy the source range to the target. The following two connections are equivalent:
<connection source = "A.OUTPUT[3:5]" target = "B.INPUT[]" /><connection source = "A.OUTPUT[3:5]" target = "B.INPUT[3:5]" />Empty brackets are needed to indicate the dimensionality of the target in some cases. For examples [][] indicates that data should copied to a two dimensional matrix. The actual ranges is copies from the source range.
For multidimensional connections several brackets are used. For example, to copy a submatrix the following notation can be used:
<connection source = "A.OUTPUT[3:5][4:7]" target = "B.INPUT[][]" />The step size of of a range can be set using a second colon. For example, 0:10:2 would copy every second element:
<connection source = "A.OUTPUT[0:10:2]" target = "B.INPUT" />If a negative step size is used, a the elements will be copied in reverse:
<connection source = "A.OUTPUT[0:10:-2]" target = "B.INPUT" />This notation is similar to ranges in Python but the result is slightly differents in that a negative step will produce the exact same element as as a positive step but in reverse order. For example 0:10:2 will produce the sequence 0, 2, 4, 6, 8 while the 0:10:-2 will produce 8, 6, 4, 2, 0.
More information can be found at the project web site: ikaros-project.