Computational algorithm

The server will perform computations on a cyclic basis. In an application there must be a root parent called a top application. The top application is a ModFrame component that is a container. A container can contain child components. The child components can both be ModFrame components and views. By adding a ModFrame components that are containers to the top application, it is possible to create a component hierarchy.

The computational algorithm of the child ModFrame components is decided by each container. For the detailed computational algorithm see the documentation of the particular container. Even though it is up to the container to decide the computational algorithm, there are two distinct algorithms that will be common to most containers.

Parallel computations

When the computations are performed in parallel, that means that the container will iterate through its child component list twice. The first iteration will read all input ports and perform the actual computations. The next iteration will write the results to the output ports. This algorithm ensures that the computational results will be independent on the computational position of the child components. However it will also have that consequence that value will take longer to propagate through components connected serially. Let's say that we have three ModFrame components connected to each other in this way: component1's output is connected to component 2's input and component 3's input is connected to component 2's output. A change on component 1's input will take three computational iteration's to reach component 3's output.

Sequential computations

When the computations are performed sequentially, the container will only iterate through its child component list once. In that iteration each component  will copy values to its input ports from the output ports of other components, read the input ports, perform computations and write to its output ports sequentially. The computational results of this algorithm are very dependent on the order of the child components. It's easier to make mistakes with this algorithm in the configuration phase, but it has the advantage of being able to propagate signals faster through connected components. The propagation can in this scenario only take one time step if the components are ordered correctly.