• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

How to make a train run through stations and platforms?  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to provide a simulation of the train passing through stations and tracks o 100 and 1000 m respectively through threads figure is like shown below

|----Glasgow-12---||-----track-----||----Sterling----||-----track-----||----Perth----||-----track-----||---Iverness----|
|----Glasgow----||-12----track-----||----Sterling----||-----track-----||----Perth----||-----track-----||---Iverness----|
|----Glasgow----||-----track-----||--12--Sterling----||-----track-----||----Perth----||-----track-----||---Iverness----|
|----Glasgow----||-----track-----||----Sterling----||--12---track-----||----Perth----||-----track-----||---Iverness----|
|----Glasgow----||-----track-----||----Sterling----||-----track-----||--12--Perth----||-----track-----||---Iverness----|
|----Glasgow----||-----track-----||----Sterling----||-----track-----||----Perth----||----12-track-----||---Iverness----|
|----Glasgow----||-----track-----||----Sterling----||-----track-----||----Perth----||-----track-----||-12--Iverness----|

Now I am able to create a thread which can run this template but i am confused as to how to make a train move through this thread.....any help would be greatly appreciated.....
Provided below are the trains, station and tracks class:
1. Train


2.Track


3.Station




4.Route


5.Display



6.Main

 
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!