metro - # # CMSC330 Project 6: Multi-threaded Train...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
############################################################################### ### CMSC330 Project 6: Multi-threaded Train Simulation ### ### Source code: metro.rb ### ### Description: A multi-threaded Ruby program that simulates ### ### the Washington Metro by creating Train and Person threads ### ############################################################################### require "monitor" Thread.abort_on_exception = true # to avoid hiding errors in threads #---------------------------------------------------------------- # Metro Simulator #---------------------------------------------------------------- def simulate(lines,numTrains,passengers,simMonitor) # puts lines.inspect # puts numTrains.inspect # puts passengers.inspect # puts simMonitor.inspect end #---------------------------------------------------------------- # Simulation Display #---------------------------------------------------------------- # line = hash of line names to array of stops # stations = hash of station names =>
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/02/2010 for the course CMSC 330 taught by Professor Staff during the Spring '08 term at Maryland.

Page1 / 2

metro - # # CMSC330 Project 6: Multi-threaded Train...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online