/* * * MAML TUTORIAL (Model 1) * For full description refer to * http://www.syslab.ceu.hu/maml/tutorial/ * * (c) 1998, CEU Systems Laboratory * */ @model m1 { // m1 is the name of the model. @var: int numOfSubscribedAgents; // A variable of the model. @agent Dumb { // An agent class named Dumb. @sub: (void) subscribe { // A subprogram of the agent. model->numOfSubscribedAgents++; // Refers to the variable of the model. } } @var: Dumb dumb, dumber; // Two agents of type Dumb. @init: // Here starts the initialization of the model. numOfSubscribedAgents = 0; @create Dumb dumb, dumber; // Creation of the two agents. [dumb subscribe]; // Invoking the subprogram on the agents. [dumber subscribe]; }