Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Recap of progress so far

• We defined a simple random mobile agent model (#1)


• Then we defined two types of influence (#2)
• From broadcast/media and social network
• However, the agents had random connections
• We then made it easier to visualize influence (#3)
• Next we made agents have their friend networks (#4)
• Each agent could have one ‘friend’ but many ‘friended’!
• Finally we found away to experiment while persisting
a friend network (#5)

Master of Business Analytics 21 November 2020 1


Recap of progress so far (contd.)
• What can we do now?
• In what way can be make the simulation more
realistic?
• In terms of heterogeneity?
• In terms of ‘social influencers’?

Master of Business Analytics 21 November 2020 2


Case Study: Version 6.0 – different networks
• Create a chooser to choose different network
structures
• Create a slider to choose network density
• Hint: Look into the
NetLogo network
extension (search
Google)
• Homework!

Master of Business Analytics 7 November 2020 3


Case Study: Version 6.0 – different networks
• Create a chooser to choose different network
structures
• Use the NetLogo Network extension
• Create random and preferential attachment networks
• Create a slider to choose network density
• To control the proportion of population that is connected to
each other – e.g. 10% connections
• 50 agents can have 50*49 connections – but since links are
undirected, there’d be half that number if each is connected
to every other (so, 10% would be how many links?)

Master of Business Analytics 20 November 2020 4


Case Study: Version 6.0 – different networks
• Change the turtle creation code to create agents using
the network extension
• Import it first at the beginning of the code:
• extensions [ nw ]
• Use it by prefixing procedures with the extension name
• e.g. nw:generate-random
• Place, colour and shape agents as before
• Select network type based on the drop-down (chooser)
• Use spring layout for better visualization
• Search on Google!

Master of Business Analytics 20 November 2020 5


Case Study: Version 7.0 – types of agents
• Create a second type of agent – “An Influential”
• Add a weight that controls how influential
“influentials” are
• Plot the adoption of each agent type

Master of Business Analytics 7 November 2020 6


Case Study: Version 7.0 – agent types (cond.)
• To create two or more types, we need to breed!
• influentials and imitators/regulars?
• Defined in UI – as a fraction (rather than absolute number)
• Where in code do we define?
• How do we define them as influential?
• How do we see which is which in the UI?
• Right-click them, count them
• New breeds default to triangle shape
• Define it to person shape using set-default-shape command
• How to change their behaviour based on their type?

Master of Business Analytics 20 November 2020 7


Case Study: Version 7.0 – agent types (cond.)
• Changing behaviours
• Influentials are only influenced by other influentials
• Can also make regulars trust influentials with higher
probability than they trust regulars
• Need to setup another slider for influence-weight
• Need to change adopt procedure
• Broadcast influence is not affected
• Check which agent category, and adopt accordingly
• So regulars will be influenced by influentials with the weight
defined in the slider and one minus that weight from regulars
• Try it yourself!

Master of Business Analytics 20 November 2020 8


Main steps in Agent Based Modeling

• Designing your model

• Building your model

• Analyzing your model

Master of Business Analytics 7 November 2020 9


Main steps in Agent Based Modeling

• Designing your model

• Building your model

• Analyzing your model

Master of Business Analytics 7 November 2020 10


Analyzing the model
• Now that we have a model we would like to analyze
• For instance, we might ask, “If we hold broadcast-
influence constant, what is the effect of different
social-influence values on the total adoption rate for
each type of agent?”

Master of Business Analytics 7 November 2020 11


Multiple Runs and Parameter Sweeping
• Whenever a model has stochastic components, you
must do multiple runs
• You also want to be able to systematically alter an
input parameter
• Then you want to take the data and analyze it
• We use BehaviorSpace for this

Master of Business Analytics 7 November 2020 12


Analysis of data
• You can use any statistical package to analyze the
data output by NetLogo
• Excel, SPSS/SAS, R
• You can also use any programming language with a
statistical/plotting library
• Python/Matplotlib

Master of Business Analytics 7 November 2020 13


BehaviorSpace
• To analyze our model, we will create a social-
influence-experiment
• Let’s vary social-influence from 0.1 to 1.0 in
increments of 0.1 (can also enumerate all values if needed)
• Let’s also set the number of agents to 100 and the density
of agents to 0.3 for fun! Just because we can!
• Can also run multiple times for any of the above How many
combinations – we’ll set it to repeat 10 times runs in total?

• We want to see all turtles who have adopted, but also how
the influentials and regulars increase with time

Master of Business Analytics 21 November 2020 14


Use Excel, R or Python to analyze
• Read the data from the file
• As csv, ignoring header – i.e. first 6 lines
• Understand the data by viewing dataset columns
• Aggregate columns by step and social influence into means
• Now plot total, influential and regular adoptions
• For each step and social influence level

Master of Business Analytics 21 November 2020 15

You might also like