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

From Wikibooks, open books for an open world
Jump to navigation Jump to search

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.

Define the advertising suggestibility of the person

  1. Open the Person class diagram
  2. Drag the Parameter 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.

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

Create a statechart

  1. Draw the following statechart:
  2. First, draw a state. Drag the State 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.
  4. Add statechart entry pointer pointing to this state as shown on the figure below. Drag the Statechart Entry Point 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:
  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.
  7. Add a transition going from the PotentialAdopter state to the Adopter state. Drag the Transition 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:
  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.