Last modified on 29 July 2009, at 14:23

Simulation with AnyLogic/Agent-Based Modeling/Step 3. Adding Adoption from Advertisement

Step 3. Adding Adoption from Advertisement

In this model the volume of advertising and the probability that a potential adopter will adopt as the result of exposure to a given amount of advertising are assumed to be constant each period. So, we will use a parameter to model the advertising effectiveness — the fractional adoption rate from advertising.

We will create this parameter in the Person class. Since all agents are represented by objects of this active object class, they have the same characteristics we define here. Optionally, you can define characteristics individually for each agent by altering values of parameters for some agents.

Step 1. Creating a new model1.gif Define the advertising suggestibility of the person

  1. Open the Person class diagram
  2. Drag the Parameter Step 3. Adding Adoption from Advertisement1.gif element from the General page of the Palette view onto the diagram.
  3. On the General page of the Properties view, set up the parameter properties.
  4. Change the name of the parameter. Type AdEffectiveness in the Name edit box.
  5. In the Default Value edit box, type 0.011.
    Step 3. Adding Adoption from Advertisement2.png

Now we will define the behavior of our agent using a statechart.

Step 1. Creating a new model1.gif Create a statechart

  1. Draw the following statechart:
    Step 3. Adding Adoption from Advertisement3.png
  2. First, draw a state. Drag the State Step 3. Adding Adoption from Advertisement4.gif element from the Statechart page of the Palette view onto the diagram.
  3. Resize it by dragging the state borders. Change its Name to PotentialAdopter.
    Step 3. Adding Adoption from Advertisement5.png
  4. Add statechart entry pointer pointing to this state as shown on the figure below. Drag the Statechart Entry Point Step 3. Adding Adoption from Advertisement6.gif element from the Statechart page of the Palette view into the graphical editor, so that its ending point got connected to the upper border of the state:
    Step 3. Adding Adoption from Advertisement7.png
  5. Now PotentialAdopter is an initial state of the statechart, since the atatechart entry pointer points to it. The person remains a potential adopter until this state is active.
  6. Add one more state below the created one. You can simply drag the PotentialAdopter state with Ctrl button pressed. This will create a copy of the state. Name this state Adopter. The person becomes an adopter, when this state becomes active.
    Step 3. Adding Adoption from Advertisement8.png
  7. Add a transition going from the PotentialAdopter state to the Adopter state. Drag the Transition Step 3. Adding Adoption from Advertisement9.gif element from the Statechart page of the Palette view onto the diagram of active object class, so that the starting point of the transition got connected to the lower border of PotentialAdopter state.
  8. Drag the ending point of the transition onto a border of Adopter state. The transition should look like in the figure below:
    Step 3. Adding Adoption from Advertisement3.png
  9. This transition models the product purchase by this person. The time needed to come to a conclusion to buy the product depends on the person’s advertising suggestibility exponentially. So, set up that this transition will be taken with AdEffectiveness rate. Go to the General page of the transition's Properties view and choose Rate from the Triggered by drop-down list. Type AdEffectiveness in the Rate field below. You can use the code completion assistant when typing the parameter name. Type only the first letters of the name and then press Ctrl+space. This will open the assistant dialog listing parameters, variables and functions of your model. Scroll to the AdEffectiveness parameter and insert its name by double-clicking on it.
    Step 3. Adding Adoption from Advertisement10.png