![]() |
Synthia
Generic and flexible data structure generator
|
Demonstration of Synthia's explainability features on a wiring of pickers producing a list of points.
The code in this example corresponds to the following diagram:
A chain of pickers is instructed to generate a list of four two-dimensional points using a PrismPicker, with constraints on their possible values. The x coordinate starts at $0$ and increments by a fixed value that is initially chosen to be either 1 or 2; the y coordinate repeatedly iterates through the values 0, 1 and -1; a PickIf removes any point lying on the line x=y. A possible first output of this chain is the list [(1,-1),(2,0),(3,1),(4,-1)].
One can then ask for a first list out of this chain, and then ask for an explanation of the first point inside the list by passing to the static method Explanation.explain() a the appropriate designator. This has for effect of linking this value to the output produced by other pickers, ultimately producing a graph such as the one shown below.
In the source code, this graph is merely printed to the console in the DOT format of the Graphviz graph rendering tool. The picture above is a beautified version of that graph using pictograms instead of text, and simplified by removing "and" nodes.
This graph is not a static template obtained from the wiring of pickers; to illustrate this fact, the graph below shows an alternate explanation, which is what one obtains when RandomInteger picks the value 2 instead of 1; in that case the output list becomes [(2,1),(4,-1),(6,0),(8,1)].
In the source code, one can change the value of the seed given to the RandomInteger r_int until this alternate graph is obtained instead of the first one.
Definition at line 82 of file ExplanationList1.java.
Static Public Member Functions | |
| static void | main (String[] args) |
|
static |
Definition at line 85 of file ExplanationList1.java.