07.II - Events

0. Introduction

Instructor: D. Grether
Co-instructors: M. Rieser, A. Horni
Lecture type: Presentation with exercises
Learning Objectives:

  • What are Events? How works the Model View Controller Pattern in general.
  • How you can analyse simulation output.
  • How to write an event handler for the events of the mobility simulations.
  • How to produce simple charts.

Exercises:

  • Write a very simple event handler producing log output to console.
  • Write a simple event handler calculating total and average travel times.
  • Write a chart writer class that plots the collected data to a chart.
  • Solutions for the exercises can be found in the class MyEventsHandling.java within the release (press Ctrl + Shift + T in eclipse and enter the class name MyEventsHandling to get to the class). Using a checkout you can find the classes in the folder src/main/java/tutorial/programming/example6EventsHandling.

 

eventsTutorial.pdfeventsTutorial.pdf
501.66 KB

Warning: Table 'watchdog' is read only query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '<em>Table &amp;#039;sessions&amp;#039; is read only\nquery: UPDATE sessions SET uid = 0, cache = 0, hostname = &amp;#039;38.107.179.231&amp;#039;, session = &amp;#039;&amp;#039;, timestamp = 1328350340 WHERE sid = &amp;#039;e972b2ab7dd755a2094beea8ac708f02&amp;#039;</em> in <em>/home01/vsp_access/matsimwww/includes/database.mysql.inc</em> on line <em>174</em>.', 2, '', 'http://matsim.org/node/414', '', '38.107.179.231', 1328350340) in /home01/vsp_access/matsimwww/includes/database.mysql.inc on line 174