Simulation with AnyLogic/System Dynamics/Step 3. Adding stocks
Step 3. Adding Stocks
Now we will add two stocks to model adopter and potential adopter populations.
Add a stock to model potential adopter population
- Drag the Stock Variable element from the System Dynamics page of the Palette view onto the diagram of active object class (right to the place where you want to locate a variable). A new variable appears on the diagram, displayed as a little blue rectangle.
- Once you have placed the element onto the diagram, it becomes selected and its properties are displayed in the Properties view. You can adjust element properties here as your model requires.
Please note that the Properties view is a context-sensitive view and it displays the properties of the currently selected element of the model. To adjust properties at a later time, first select the element (e.g. by clicking on the element in the graphical editor) and then modify the required properties.
Properties view. At the moment view displays the properties of the currently selected stock variable. - Change the name of the stock. On the General page of the Properties view, type PotentialAdopters in the Name edit box.
Add a stock to model adopter population
- Add another stock in the same way. Place it to the right of the PotentialAdopters stock as shown in the figure below.
- Name this stock Adopters.
- Move text labels of the stocks above stocks' icons. Do it in the following way: first select a variable by clicking on it (if selected, it is drawn in a blue outline and its label is underlined) and then drag the label wherever you like. Place labels as on the figure below:
We need this since otherwise later these labels will be painted over with arrows pointing from one stock to other.
At this point, the stocks are not defined properly. We have not defined integral functions and initial values for our stocks yet. But we will create the adoption flow first.