This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
pakennyusa's profile picture

F.I.R.M.S - A Fully Intelligent Railway Management System for TrainCraft and

Started by pakennyusa, 12 October 2016 - 11:32 PM
pakennyusa #1
Posted 13 October 2016 - 01:32 AM
I'm not sure if this idea would constitute as a computer craft OS, but given its functionality I could see it as becoming one in the future versions.

Its really simple, I noticed that in major urban areas where subway systems are most commonly used, they have display board that present commuters with details about trains and times of departures, arrivals and other related information. My initial plan was to use a series of computer terminals and hook them up the a set of wireless modems that are spread out underneath the underground rail line. As the train passes over the rail craft locomotive sensors it sends a red stone pulse to the computer which interprets the red stone signal as a positive response (lets say the train is 3 mins from the station) the computer would then broadcast this information to the station server computer (using wireless Modem) the station server would then update the display board for that track (each display is 1x8 monitor with scrolling text) The display would countdown the minutes until that train reached the station.

Prior to the train entering the station there would be a arrival warning sent out from the last sensor closest to the entrance to the station platform. Once triggered, the displays in the station would begin flashing ARRIVING - STAND BACK

Once the train pulls into the station and parks on top of the boarding sensor (a locomotive sensor at the mouth of the exit tunnel to the station) The sensor would send another wireless pulse to the display boards indicating passengers to board the train. (BOARD NOW) As a additional feature malsis iron sliding glass doors would open on the platform allowing passengers to safely board and disembark the train. The system would wait about 60 seconds or more to allow passengers to get on or off the train. once this time has expired, the system will play a audible warning tone then close the boarding doors and change the display board to say STEP BACK - DEPARTING

The train leaves and the cycle repeats when the next train arrives at the 1st countdown trigger sensor.

I also plan on making the entire system manageable from a portable computer terminal which will be password encoded for security reasons. The entire system will also function as a station wide announcement system so staff and station managers can alert riders about delays and such throughout the entire station network. Not only that but I plan on connecting the system to a fire alarm system I made way back that will alert customers to exit the station and then stop all trains and activate the water system to put out the fire in a tunnel or station.

Overall, the system is fairly straight forward but if you have any ideas or suggestions please let me know.

Thanks.
Larry84 #2
Posted 13 October 2016 - 02:15 PM
Amazing idea! Even though it is quite common… But I've always liked computers and trains! :D/>/> Do you already have some ideas for how to code it? Maybe something already written (besides the fire alarm)?
Edited on 13 October 2016 - 04:08 PM
H4X0RZ #3
Posted 13 October 2016 - 04:59 PM
I wouldn't let the trains handle the display. That's like letting your fridge control your toaster. Either make the display fetch it's information from the train (but also verify the information. You never know what might happen), or use a third-party which fetches the information from the train(s) and then relays it to the display(s).
Larry84 #4
Posted 13 October 2016 - 09:04 PM
Well, isn't it the same? Directly or indirectly, the train will always control monitors as long as monitors needs to display infos about the status of the train.
H4X0RZ #5
Posted 13 October 2016 - 11:32 PM
I guess in Minecraft (and CC) it is "okay" to let the trains control the displays directly. Although there's no way for you to tell if you received a pristine message from a train, or a hijacked one from some other device.

You COULD implement something like a "block-chain" where every device gets every message/command, logs it somewhere and then compares with every other device. If one device received a bad message there is a high chance that none (or just a few) of the other ones received the same message (or a message at all) and that might mess with hackers. Although you would need one device you COMPLETELY trust so you should put it somewhere hidden, like underneath the rails where the trains dock.

If you also add something like a password (or, even better, encryption) you can safely send commands to you devices using a pocket computer now too, because hackers would need that password. Maybe even use Diffie-Hellman to decide about a second key and a secret port to communicate over.

You could go a long way, trying to make it secure, or you just make it "work". It's your decision :P/>
Or make everything wired. That would fix all the communication problems too.
Edited on 13 October 2016 - 09:33 PM
Larry84 #6
Posted 14 October 2016 - 02:43 PM
Now I've understood. The lack of security and verified communications has always been a problem in minecraft/computercraft/large networking. Wired networking may be a powerful solution, considered that most of the train detectors will also be quite far away from the station (and making lots of repeater satellites is a pain).

-snip-
If you also add something like a password (or, even better, encryption) you can safely send commands to you devices using a pocket computer now too, because hackers would need that password. Maybe even use Diffie-Hellman to decide about a second key and a secret port to communicate over.
-snip-
That's really interesting! I've never heard that before (even though I'm not a fan of encripting), but with a rapid search on the net I've at least got an idea. Do you have some other documentation (or a post) in wich it is explained for lua/cc?