Basics - Gianfrancoalongi/murenzhuang GitHub Wiki

Basic components

MRZ constructs features by constructing a system graph using Nodes:{ STDIN , STDOUT ,Output files, Mutators} and connecting them with Edges. The first system is the Root Program. These are the basic building blocks of the system MRZ will ask you to implement. MRZ presents the system to implement in a visual way using a graphviz digraph.

STDIN

STDIN is from where the data always comes to the program. The input data to the system MRZ asks you to implement always follow these rules

  1. consists of character 'a-z' and number 0-9
  2. no other characters (whitespace etc)

STDOUT

STDOUT is the standard output source for the first system MRZ will ask you to implement.

Output files

Output files are files on disk that hold some specific output of the system MRZ asks you to implement. The naming is simple and follows the following scheme 'file_X' where X is a number.

Mutators

Mutators are part of the functional core of the system and are what actually modifies the input data. A mutator is a simple description of a function that takes input data - is able to hold it in a memory and then apply some transformation on it, sending some result along to whatever node is connect to the output edge of the Mutator.

Root Program

The Root Program is the most basic system that MRZ always starts with. It is is the system that takes whatever comes in from STDIN and outputs it to STDOUT. The digraph has two nodes (STDIN and STDOUT) and one edge connecting them. The edge is the output edge for STDIN and the input edge for STDOUT.


The MRZ cycle

MRZ constantly cycles you through 2 states. The 'solid' and 'change' states.

Solid state

The MRZ system always starts in the 'solid' state with the Root Program. When in the solid state - the button on the MRZ page will say 'Next step' - all components in the image will be black.

Solid state

Pressing the 'Next step' button will take you to the 'Change' state - adding a new feature initially, but then it can remove or add features randomly. The root program will always be the smallest possible system.

Change state

In the Changes state - MRZ asks you to either ADD or REMOVE a feature - the button on the MRZ page will say 'Done'. When ADDING a feature, the component to be added is marked in green - along with the path that is added.

Adding a new file Adding a new mutator

When REMOVING a feature, the component to be removes is marked in red - along with the path that is removed.

Removing a file Removing a mutator

pressing the button 'Done' will take you to the 'Solid' state, and show you an updated system, with the extra feature - or without it.