15.08.2015 Views

Introduction to the Modeling and Analysis of Complex Systems

introduction-to-the-modeling-and-analysis-of-complex-systems-sayama-pdf

introduction-to-the-modeling-and-analysis-of-complex-systems-sayama-pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

10.2. INTERACTIVE SIMULATION WITH PYCX 179Under <strong>the</strong> “Settings” tab <strong>of</strong> <strong>the</strong> control window, you can change how many times <strong>the</strong>system is updated before each visualization (default = 1) <strong>and</strong> <strong>the</strong> length <strong>of</strong> waiting timebetween <strong>the</strong> visualizations (default = 0 ms). The o<strong>the</strong>r two tabs (“Parameters” <strong>and</strong> “Info”)are initially blank. You can include information <strong>to</strong> be displayed under <strong>the</strong> “Info” tab as a“docstring” (string placed as a first statement) in <strong>the</strong> initialize function. For example:Code 10.7:def initialize():’’’This is my first PyCX simula<strong>to</strong>r code.It simulates r<strong>and</strong>om motion <strong>of</strong> n particles.Copyright 2014 John Doe’’’global xlist, ylist...This additional docstring appears under <strong>the</strong> “Info” tab as shown in Fig. 10.2.Figure 10.2: Information about <strong>the</strong> simulation added as a “docstring” in <strong>the</strong> initializationfunction.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!