Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MP System and Software Behavior Modeling Tool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Monterey Phoenix
MP System and Software Behavior Modeling Tool
Commits
d624074d
Commit
d624074d
authored
5 years ago
by
Auguston, Mikhail
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
437e282d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Firebird_Pre_loaded_examples/Example43_Histogram.mp
+48
-0
48 additions, 0 deletions
Firebird_Pre_loaded_examples/Example43_Histogram.mp
with
48 additions
and
0 deletions
Firebird_Pre_loaded_examples/Example43_Histogram.mp
0 → 100644
+
48
−
0
View file @
d624074d
/* Example 43
Histogram example, run for scopes 1, 2, 3, and up
*/
SCHEMA Example
ROOT A: (<<0.2>> a1 | <<0.3>> a2 | (* a3 *));
ATTRIBUTES { number count; };
GLOBAL
/* This GRAPH is used as a container to collect data about valid trace probabilities.
The following MP code can be reused for any MP model just by Copy/Paste. */
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 .. 1] STEP 0.1
DO
Node$x: 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) OR
/* special case when the only single trace with probability 1 exists */
( #$$TRACE == 1 AND Num$n == 0.9 ) THEN
Node$x.count +:= 1;
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;
};
SHOW probability_chart SORT;
/* The contents of the chart is sorted by X_AXIS string values, since the order of adding rows to the
TABLE may be arbitrary */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment