Computer controlled railroad simulator
Download
1 / 16

Computer-Controlled Railroad Simulator - PowerPoint PPT Presentation


  • 116 Views
  • Uploaded on

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

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Computer-Controlled Railroad Simulator' - rumor


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Computer controlled railroad simulator

Computer-Controlled Railroad Simulator

Adrian Anderson

http://compsci.snc.edu/cs460/andeaj/


Project description
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


Solution
Solution

  • Computer-Controlled Railroad Simulator

  • Written in Visual Basic 2005, using .NET


Simulator
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


Track editor
Track Editor

  • Track data stored in an XML file

  • Loaded and stored in an internal database

  • Fully customizable

  • Allows for many different track arrangements


Communications
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


Methodology
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


Methodology1
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


Methodology2
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


Methodology3
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


Exceptions
Exceptions

  • Saved state of trains and track

  • Save status log to a file

  • XML validation

  • Preset train types

  • More labels in simulator window



Learning development
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


Extensions
Extensions

  • Read more types of hardware packets

  • Advanced collision detection

  • More detailed graphical layout

  • More detailed object information


Advice
Advice

  • Start early

  • Set concrete goals with deadlines

  • Meet those deadlines

  • Update journal often with small updates