Please review any and all PUBLIC repositories, groups and associate files. These allow anyone on the Internet to access without authentication. Repository and group owners are responsible for their content and permission settings. Go to your project(s), click on Settings > General and expand the "Visibility, project features, permissions" to change this setting.

Commit 5f08330c authored by Auguston, Mikhail's avatar Auguston, Mikhail

Delete example49.mp

parent 8ceddacf
/*
// example49.cpp
// histogram example, run for scopes 1, 2, 3, and up
// Created by Mikhail Auguston on 11/15/19.
*/
SCHEMA Example
ROOT A: (<<0.2>> (+ a1 +) | (<<0.4>> a2 | (* a3 *) ) | <<0.3>> a4);
ATTRIBUTES { number count; };
GLOBAL
/* this GRAPH is used as a container to collect data about valid trace probabilities */
GRAPH Data { };
WITHIN Data{
/* numerical_loop_header(40) is used to perform required interval calculations. */
FOR Num$t: [1.. #$$TRACE] STEP 1
DO
FOR Num$n: [0 .. 0.9] STEP 0.1
DO
Node$f: LAST( Num$n ".." Num$n + 0.1);
/* p - pre-defined trace probability attribute */
IF Num$n <= #$$TP(Num$t) AND
#$$TP(Num$t) < Num$n + 0.1 THEN
Node$x: LAST( Num$n ".." Num$n + 0.1);
Node$x.count +:= 1;
/* SAY("created node " Node$x " with count " Node$x.count); */
FI;
OD;
OD;
}; /* end of WITHIN Data */
TABLE probability_histogram {
TABS string probability_interval,
number trace_count; };
BAR CHART probability_chart { TITLE("Trace probabilities");
FROM probability_histogram;
X_AXIS probability_interval; };
WITHIN Data{
FOR Node$n
DO
probability_histogram <|
probability_interval: SAY(Node$n),
trace_count: Node$n.count;
OD;
};
SAY("Total " #$$TRACE " traces for scope " $$scope);
SHOW probability_histogram;
SHOW probability_chart SORT;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment