1 / 16

Computer-Controlled Railroad Simulator

Computer-Controlled Railroad Simulator. Adrian Anderson http://compsci.snc.edu/cs460/andeaj/. Project Description. Create a model railroad simulator Show graphic representation of trains, turnouts, and sensors Allow for a custom track design

rumor
Download Presentation

Computer-Controlled Railroad Simulator

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer-Controlled Railroad Simulator Adrian Anderson http://compsci.snc.edu/cs460/andeaj/

  2. Project Description • Create a model railroad simulator • Show graphic representation of trains, turnouts, and sensors • Allow for a custom track design • Receive hardware commands from external programs, and send response commands back • Allow the user to recreate certain conditions • Simulate hardware failure

  3. Solution • Computer-Controlled Railroad Simulator • Written in Visual Basic 2005, using .NET

  4. Simulator • Internally stores the state of trains, turnouts, and sensors • Moves trains around a virtual track • Interface for controlling the track and trains • Simulation of ideal, controlled railroad conditions • Check for train collisions • “Disasters” – see what happens when things go wrong

  5. Track Editor • Track data stored in an XML file • Loaded and stored in an internal database • Fully customizable • Allows for many different track arrangements

  6. Communications • Receives NMRA standard digital railroad controller packets • External programs can interface with the simulator as if it were a real railroad • Change train speed and direction • Request state of all sensors • Good for testing programs like the Train Operating System

  7. Methodology • Problem: Represent track as computer data • Solution: • Junctions • Segments, which go from junction to junction • Turnouts, which connect two segments at a junction • Sensors, which are connected to segments

  8. Methodology • Problem: Save and store track data • Solutions: • Internal Storage: DataSet Class • Visual Basic class, relational database • ReadXML command reads and interprets XML files • External Storage: XML • Easy to read, interpret, and edit • Standard format for miscellaneous data • Easy to validate • Easy to use in Visual Basic programs

  9. Methodology • Problem: Collision detection • Solution: • Collision table • Train’s movement leaves records in the collision table • Compare a train’s potential destination with collision table records on the same segment/junction • If two records overlap, then the trains crash • Sensor detection: Trains “collide” with sensors to activate them

  10. Methodology • Problem: Collision detection • Solution: • Collision table • Train’s movement leaves records in the collision table • Compare a train’s potential destination with collision table records on the same segment/junction • If two records overlap, then the trains crash • Sensor detection: Trains “collide” with sensors to activate them

  11. Exceptions • Saved state of trains and track • Save status log to a file • XML validation • Preset train types • More labels in simulator window

  12. Demonstration

  13. Learning & Development • References • MSDN Library • Win 32 System Services: The Heart of Windows 95 and Windows NT • CS Concepts • Database – track representation, track editor • Operating Systems – pipe communication, threading

  14. Extensions • Read more types of hardware packets • Advanced collision detection • More detailed graphical layout • More detailed object information

  15. Advice • Start early • Set concrete goals with deadlines • Meet those deadlines • Update journal often with small updates

  16. Questions?

More Related