This is an old revision of the document!
Proc statement
Passive agents are used to store data shared among agents and to avoid the simultaneous use of such data by two or more agents. They provide a set of procedures that can be called by other agents. Each procedure has its own port attached and a communication with a passive agent via that port is treated as the corresponding procedure call. Depending on the communication direction, such a procedure may be used to send or collect some data from the passive agent.
proc (g) p {...}
Listing 1. Proc statement syntax, where g
stands for a guard and is optional and p
stands for the corresponding port name.
A procedure is accessible for other agents only if the guard evaluates to True
.
Example
This is a part of a model only!
agent Buffer { i :: Int = 0; proc pop { out pop i; } proc push { in push i; } }