[Next] [Previous] [Up] [Top] [Contents]

Section 3 - Agents and some user facilities

3.1 Setting up agents


Start up SDML and enter the sdml-intro3 workbench. Browse the module's type hierarchy. Select the type Agent and add two subtypes below this Producer and Consumer.

Since the Producer and Consumer types only inherit from Agent, they are simple agents. However the model agent has to be able to contain all these simple agents. So we will make it a sub-type of parallelCompositeAgent. We chose this composite type as we will want to simulate the actions of its component agents acting simultaneously.

Select the type ParallelCompositeAgent and add ModelAgent as a subtype. Browse the definitions of ModelAgent under the category stages. You will notice that some predicates we used yesterday (like timeLevels) are not there.

We also need the model to loop over its time levels, so its type has to inherit from LooopingAgent as well as ParallelCompositeAgent.

This is called multiple inheritance, where something may inherit the features of more than one ancestor in a hierarchy.

Select the LoopingAgent type and add ModelAgent as a subtype of this. The Type hierarchy should now look something like this.

ModelAgent is now a looping parallel composite agent. You will now see the timeLevels predicate if you browse the stages category of ModelAgent's definitions.


An introduction to SDML - Bruce Edmonds - 13 JUL 99
[Next] [Previous] [Up] [Top] [Contents]

Generated with CERN WebMaker