/* * * MAML TUTORIAL (Model 1.1) * For full description refer to * http://www.syslab.ceu.hu/maml/tutorial/ * * (c) 1998, CEU Systems Laboratory * */ @model m1 { @var: int numOfSubscribedAgents; @agent Dumb { @sub: (void) subscribe { model->numOfSubscribedAgents++; } } @var: Dumb dumb, dumber; @init: numOfSubscribedAgents = 0; @create Dumb dumb, dumber; [dumb subscribe]; [dumber subscribe]; } @observe m1 as graphical_m1 { // graphical_m1 is the name of this observation of m1. @probe: var "numOfSubscribedAgents"; // This variable will be probed. @init: // Here starts the initialization of the observer. @buildProbes; // Here all the probes are created. [model probe]; // Displays the model's probes. }