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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

178 CHAPTER 10. INTERACTIVE SIMULATION OF COMPLEX SYSTEMSRun this code, <strong>and</strong> you will find two windows popping up (Fig. 10.1; <strong>the</strong>y may appearoverlapped or <strong>the</strong>y may be hidden under o<strong>the</strong>r windows on your desk<strong>to</strong>p) 12 .Figure 10.1: Graphical user interface (GUI) generated by pycxsimula<strong>to</strong>r.py. Left: Visualizationwindow. Right: Control window.This interface is very minimalistic compared <strong>to</strong> o<strong>the</strong>r s<strong>of</strong>tware <strong>to</strong>ols, but you can still dobasic interactive operations. Under <strong>the</strong> “Run” tab <strong>of</strong> <strong>the</strong> control window (which shows upby default), <strong>the</strong>re are three self-explana<strong>to</strong>ry but<strong>to</strong>ns <strong>to</strong> run/pause <strong>the</strong> simulation, update<strong>the</strong> system just for one step, <strong>and</strong> reset <strong>the</strong> system’s state. When you run <strong>the</strong> simulation,<strong>the</strong> system’s state will be updated dynamically <strong>and</strong> continuously in <strong>the</strong> o<strong>the</strong>r visualizationwindow. To close <strong>the</strong> simula<strong>to</strong>r, close <strong>the</strong> control window.1 If you are using Anaconda Spyder, make sure you run <strong>the</strong> code in a plain Python console (not anIPython console). You can open a plain Python console from <strong>the</strong> “Consoles” menu.2 If you are using Enthought Canopy <strong>and</strong> can’t run <strong>the</strong> simulation, try <strong>the</strong> following:1. Go <strong>to</strong> “Edit” → “Preferences” → “Python” tab in Enthought Canopy.2. Uncheck <strong>the</strong> “Use PyLab” check box, <strong>and</strong> click “OK.”3. Choose “Run” → “Restart kernel.”4. Run your code. If it still doesn’t work, re-check <strong>the</strong> “Use PyLab” check box, <strong>and</strong> try again.

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

Saved successfully!

Ooh no, something went wrong!