so besides the environmental variable
int and the mobile variant we also had a
network bearing and I you know I kind of
wanted to do this just to tie it back
into unit for among other things but it
kind of gives you some idea of the fact
that you can make these models very
versatile and you can analyze them in a
number of different ways so here we have
one of our networks in this case it's
just a random network has been created
and we're gonna go ahead and set up and
we hit go and we can see the disease
spreading through the network right now
because of the fact that in this
particular model some of the nodes are
not going to be attached to the overall
net where some of the individuals are we
actually don't always see a high percent
infection so we have to think a little
bit more about how to address that when
we're analyzing the model results so for
instance let's say we want to look at
how debris the average degree of an
individual this connections per node
affects the number of the the the the
overall spread in the network well we
can't look at to 100% infection but
maybe we can say how many people for
instance are infected after 15 ticks so
let's go ahead and create an experiment
that does that so we can go into littles
behavior space pull it up and there is
one called degree already in here the
various degree the average number of
connections per node from 1/2 to 4 by
increments of 1/2 and this is just
saying how many connections on average
should we have for node and so we can
have 1/2 because we can say roughly
every other person has a connection
right and so then we can just repeat
them all 10 times running at 10 times
for each of those values we can count
the number of turtles with infected as
our measure of output and we can set it
to stop after 50 ticks so basically were
saying my preference of ticks tell me
how many people are infected that's what
I'm going to use my measure as to how
the density of or effects infection
spread so let's go ahead and run the
action and we will then pool and results
into our and analyze it they're
not with me you know we'll see the model
run and it takes a little bit slower
than some of the other models because
the networks actually create a lot more
agents because each of the links is now
in agents as well right so it's all done
let's blow the door okay we're back in
our and we're gonna start out almost
exactly the same way we start out for
the books of summary graphs and the
environmental graphs will pull it in the
age of this library we'll pull in our
data file which is now called degree
because we're looking at the degree
experiment we'll give it some column
names to make it easier to manipulate
right and you know now we're actually
are the output of our data file is now
actually the number of infected right
not the time two percent one percent
affection so it's more like the time
series data in that respect but
everything is stopping at time ticks 50
and we're all the outputting those
results so that was one other small
change we need to the behavior space if
you notice when we ran it right and then
we're gonna aggregate that data by
degree and they're gonna get some errors
because of some different anaise and
stuff like that are in there and it will
just show the summary data right says
degree means standard deviation three
main Center views what's interesting
right is that you get high standard
deviations for these middle ranges and
that's basically because in this case
the network's not very connected in this
case the network's almost always
connected in between you get these cases
for fewer or more individuals get
connected so network and so then we can
just plot all the data ready if we look
at that
the graph looks like this and as you can
see right you get this case where a lot
of
wind up being affected but for some of
these middle degrees right you get cases
where quite a few people don't get
infected by 50 and that might be because
the infection is trapped in a small part
of the network that's not connected to
the rest of the network right
but if we then save this off or we then
look at the aggregate data using the
under command right you see it shows up
as these huge variations but this is one
of the reasons why I often like to look
at all the data right because it's not
really a matter of huge variations it's
a matter of the thermocouple of data
points where the actual infection gets
stuff in a part that's not connected to
a large graph and so you'd have to think
you should actually not be treating this
now is normally distributed data because
actually has this kind of bimodal
distribution where some of the data is
here and some of the data is here and so
that means this graph is actually
somewhat misleading right because it's
actually showing you these huge standard
error bars but because the data is
actually split across two modes it's not
actually a very informative graph right
as to what's going on because we're not
telling you anything about the data is
down here instead you should think about
some sort of other graph or thinking
about changing your model to allow to
make sure that everyone is connected to
the network for instance in which case
this would be a better description
what's going on so it's that's just I
thought it was an important point to
make the critical point here is that you
can use network data in the same way
you could use anything else here we're
using degree to control the outputs but
you could have used clustering
coefficient or something else as your
independent nerves your your independent
variable to control the network