Greetings John Balwit here for the final assignment in the intermediate section homework. We're asked to modify this logistic map information content model to allow the user to set a threshold for the symbolic dynamics. In the current model it's hardcoded to 0.5. Investigate whether changing the threshold changes the information content measured for various values of R. Ok. So, let's look at the model. We're told that we're to change the threshold value. If we peek into the code, we can see... we're told that it was set for 0.5, and certainly there it is, hardcoded. I frequently find myself changing hardcoded values to slider values to investigate models, and that's exactly what we're going to do here. So I'm going to make a slider called "threshold" and we'll put that on the interface. Right like so. And we're going to set the values. This can run from 1 to... let's say we set a low of 0.1 and we'll do increments of 0.1. So there we have it. We've created a new slider that controls that threshold. So that was the easy part. Now we need to conduct some experiments. Of course if we do it right as it is, right now, it's just exactly how it was formerly. But now, we can change this. Now, often in these models it's hard... You can have a notepad and can copy down these values. But there's an easier way that's built right into NetLogo that allows you to run multiple experiments. I want to introduce you to something called "BehaviorSpace." It's in the "Tools" and if you look here, "BehaviorSpace," you can create an experiment. Let's say "experiment with r", that's what I'll call it. This shows you the sliders that are on your model. We have a slider for the initial value. I always like to start out at 0.5. And the values for R... you can put in multiple values. Let's check out R at 3.0, 3.5, and 3.8. So we're going to look at those distinct values of R. And we're going to also try out different threshold values. Try out a threshold value of 0.2, 0.5, and 0.7. Or, well, for symmetry let's do 0.8. So now what we've done is we've set up a set of nine experiments that will be run because each one of these values of R will be tested at this threshold: at 0.2, and at 0.5 and at 0.8. And likewise we could run these multiple times to see how accurate our results are. But since this is a deterministic system we don't need to do those things more than once. In this case we're not going to be counting turtles. But we're interested in this variable, the "info-content." And how I determined that is, I peeked behind the scenes of this plot right here, and that's the value we're interested in: information content. This plot is driven by the global variable "info-content". Which we can see in the global variables. So let's see here, we're measuring info-content. We don't want to measure runs at every step, so I'm going to check that off. We do want to set up some time limits. Let's run this for 15 steps and then we'll take the measure of info-content. We can change these later. But that should be good. Let's see how this works. It says that there's going to be 9 runs, that accords with what we saw with the mix of threshold and R parameters. And we'll run this. To save it, we'll give it a name, called "complexity-R vs. threshold." Descriptive name. Make a new folder. Call it "test." It will be on my desktop. Actually let's make a new folder here called "test" and create that. Now we're ready to run. So boom, very quickly. Go to the finder, look on the desktop, and find test. There's our model. And we can see... I'll zoom in a little bit. We can see that when R was 3, the information content was 0 at all three different threshold settings. When we moved into the second bifurcation, that set value 3.5 then we started to see that the information content was zero if we used a low threshold setting. An intermediate value at 0.5. And 1 if we used a higher setting. And of course that makes sense because we're capturing those different bifurcations in different sets. So at a certain setting we're going to group those into two different groups, essentially 0 and 1, and we'll have a high information content. So this allows us to look at this model and check the sensitivity to different kinds of parameters that we set. "Parameter sweeping" is what they call this in agent-based modeling. Where you've very interested in how sensitive models are to different changes in parameters. And we can see this here with the information content. There's a lot of experiments and a lot of exploration we could do with different regions of R and different kinds of thresholds. And I think it will be very interesting to look at different regions of the logistic map. I just want to point out one other thing here. I don't know, I assume you've had a chance to play around with the logistic map bifurcation diagram, but this gives us a chance to see actual regions of the bifurcation diagram that are particularly of interest. And I'd be very interested in checking this region right here. But in this particular model, in order to find out what this R value is I have to do a little bit of simple math. Because I build this world so that it was 2000 pixels wide and the patches correspond to the value of R in this case. So if I wanted to know what the R value for right here was, I could inspect the patch and find that it's patch 1923, so the x value of this patch is 1923, so I could do a little math on that. I can use the observer here as a little calculator. I'll try to make this big so you can see it. I can say... (thinking) what was that value over here? It was 1928. So I can say show me 1928, divided by the total number of pixels, 2000, times 4. Because my virtual range is from 0 to 4. And that should show me that we're at an R value of approximately 3.85. So we can go back to our other model, and we could edit this run so we're looking specifically at those values. 3.84. And that might be very interesting, to just look at a bunch of values right around there and see if we can find the change, or find a way to measure that departure from randomness that we see visually in the bifurcation diagram because in the end, that's what the information content is. It's a way to measure how far you've departed from a random situation. So, hope that helps.