@@ -195,6 +195,7 @@ we can set up our simulation with the following code:
195195 sim = InteractiveContext(
196196 components = [Population()],
197197 configuration = {' population' : {' population_size' : 500 }},
198+ logging_verbosity = 0 ,
198199 )
199200
200201 # Peek at the population table
@@ -210,6 +211,7 @@ we can set up our simulation with the following code:
210211 sim = InteractiveContext(
211212 components=[Population()],
212213 configuration={'population': {'population_size': 500}},
214+ logging_verbosity=0,
213215 )
214216
215217::
@@ -316,6 +318,7 @@ Let's run the simulation with our new component and look again at the population
316318 sim = InteractiveContext(
317319 components = [Population(), Movement()],
318320 configuration = {' population' : {' population_size' : 500 }},
321+ logging_verbosity = 0 ,
319322 )
320323
321324 # Peek at the population table
@@ -330,16 +333,21 @@ Let's run the simulation with our new component and look again at the population
330333 sim = InteractiveContext(
331334 components=[Population(), Movement()],
332335 configuration={'population': {'population_size': 500}},
336+ logging_verbosity=0,
333337 )
334338
335- ::
339+ # Peek at the population table
340+ print(sim.get_population().head()[["color", "x", "y", "vx", "vy"]])
341+
342+ .. testoutput ::
343+
344+ color x y vx vy
345+ 0 red 274.256447 907.889319 -0.396940 0.270696
346+ 1 red 388.784077 82.116094 0.392572 -1.693871
347+ 2 red 661.272905 303.481468 -0.102927 1.194465
348+ 3 red 758.825839 806.284468 0.709814 0.932636
349+ 4 blue 574.989313 159.504556 -1.487996 1.428098
336350
337- tracked color entrance_time vy vx x y
338- 0 True red 2005-07-01 -1.492285 -1.546289 786.157545 686.064077
339- 1 True blue 2005-07-01 0.360843 1.662424 530.867936 545.621217
340- 2 True red 2005-07-01 -0.369045 -1.747372 779.830506 286.461394
341- 3 True red 2005-07-01 -1.479211 0.659691 373.141406 740.640070
342- 4 True red 2005-07-01 1.143885 0.258908 20.787001 878.792517
343351
344352Our population now has initial position and velocity!
345353Now, we can take a step forward with ``sim.step() `` and "see" our boids' positions change,
@@ -361,18 +369,22 @@ but their velocity stay the same.
361369 sim = InteractiveContext(
362370 components=[Population(), Movement()],
363371 configuration={'population': {'population_size': 500}},
372+ logging_verbosity=0,
364373 )
365374 sim.step()
366375
367- ::
376+ # Peek at the population table
377+ print(sim.get_population().head()[["color", "x", "y", "vx", "vy"]])
368378
369- tracked color entrance_time vy vx x y
370- 0 True red 2005-07-01 -1.388859 -1.439121 784.718424 684.675217
371- 1 True blue 2005-07-01 0.360843 1.662424 532.530360 545.982060
372- 2 True red 2005-07-01 -0.369045 -1.747372 778.083134 286.092349
373- 3 True red 2005-07-01 -1.479211 0.659691 373.801097 739.160859
374- 4 True red 2005-07-01 1.143885 0.258908 21.045909 879.936402
379+ .. testoutput ::
375380
381+ color x y vx vy
382+ 0 red 273.859507 908.160016 -0.396940 0.270696
383+ 1 red 389.176649 80.422223 0.392572 -1.693871
384+ 2 red 661.169977 304.675933 -0.102927 1.194465
385+ 3 red 759.535654 807.217104 0.709814 0.932636
386+ 4 blue 573.546355 160.889428 -1.442958 1.384873
387+
376388
377389Visualizing our population
378390--------------------------
@@ -406,6 +418,7 @@ We can then visualize our flock with
406418 sim = InteractiveContext(
407419 components = [Population(), Movement()],
408420 configuration = {' population' : {' population_size' : 500 }},
421+ logging_verbosity = 0 ,
409422 )
410423
411424 plot_boids(sim, plot_velocity = True )
@@ -418,6 +431,7 @@ We can then visualize our flock with
418431 sim = InteractiveContext(
419432 components=[Population(), Movement()],
420433 configuration={'population': {'population_size': 500}},
434+ logging_verbosity=0,
421435 )
422436 plot_boids(sim, plot_velocity=True)
423437
@@ -517,6 +531,7 @@ For a quick test of our swarming behavior, let's add in these forces and check i
517531 sim = InteractiveContext(
518532 components = [Population(), Movement(), Neighbors(), Separation(), Cohesion(), Alignment()],
519533 configuration = {' population' : {' population_size' : 500 }},
534+ logging_verbosity = 0 ,
520535 )
521536
522537 sim.take_steps(100 )
@@ -531,6 +546,7 @@ For a quick test of our swarming behavior, let's add in these forces and check i
531546 sim = InteractiveContext(
532547 components=[Population(), Movement(), Neighbors(), Separation(), Cohesion(), Alignment()],
533548 configuration={'population': {'population_size': 500}},
549+ logging_verbosity=0,
534550 )
535551 sim.take_steps(100)
536552 plot_boids(sim, plot_velocity=True)
@@ -562,6 +578,7 @@ Then, try it out like so:
562578 sim = InteractiveContext(
563579 components = [Population(), Movement(), Neighbors(), Separation(), Cohesion(), Alignment()],
564580 configuration = {' population' : {' population_size' : 500 }},
581+ logging_verbosity = 0 ,
565582 )
566583
567584 anim = plot_boids_animated(sim)
0 commit comments