[Next] [Previous] [Up] [Top] [Contents]
Section 2 - Modules, Time Levels and Lists
In this model we are going to implement a queue of consumers who will buy in turn from the producers. To implement this we are going to add a second time level of iteration. Each iteration will be a stage within each week where each customer in turn chooses a producer and makes a purchase.
Go to (or restart) a browser on Type: UniversalAgent (maybe via the universe). Select the Objects page and the Instances of type: TimeLevel. In the Objects: pane use the command button to select add object and enter iteration in the dialogue box that appears. You can now close this browser as we will not need it again.
Now change the rules in the Initial eternity rule base of the Type: ModelAgent so the activate time levels rule has consequent all eternity (timeLevels [week iteration]) and the start times rule has consequent:
and
initialTime week 1\
initialTime iteration 1
Notice the use of and in the consequent to assert more than one clause. Now the execution of rulebases in the model will go something like this:

Thus there is only one content database, however many timelevels you have. Here the complete initial iteration-content-Final iteration cluster acts like the content rulebase for the week time level.
The intention is that:
- The Initial eternity rulebase will set up and initialise the other time levels.
- The Initial week rulebase will be for setting the model parameters and creating the consumers.
- The Initial iteration rulebase (which is fired at the start of each week) will be where new producers enter the market, producers set their prices, consumers will be allocated money and requirements and the queue will be formed.
- the Content rulebase will have the rules to update the queue and for each customer to make a purchase in turn.
- The Final iteration rulebase (fired at at the end of each week) will be for accounting.
- The Final week rulebase could be used for collecting statistics about the simulation.
- The Final eternity rule base will not be used.
An introduction to SDML - Bruce Edmonds - 13 JUL 99
[Next] [Previous] [Up] [Top] [Contents]
Generated with CERN WebMaker