Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2005

Tip: Looking for answers? Try searching our database.

jxta use

Thread view: 
mark - 25 May 2005 23:23 GMT
how to model a train system to include track and, to begin with two trains.
at present i have implemented using a vector two train objects fit into
vector at different positions and each has a move method which changes
postion +1 and replaces old position with a "empty block". (when vector
reaches end goes to beginning - creating a circular track) when one train
catches up to another it has to wait. what i want is for a transaction to
occur between trains and maybe control centre that involves train1 telling
train2 to speed up. have not been able to reference get name of train from
vector only that it is a train object - then i want to say train2.speedUp().

is this a fair model. i thought of using two dimensional vector to involve
tracks which intersected.

is there a more obvious model to choose - i have had jxta mentioned to me to
use trains as peers - but have no experience of this.

thanks for any help
mark
Bill Tschumy - 26 May 2005 22:32 GMT
> how to model a train system to include track and, to begin with two trains.
> at present i have implemented using a vector two train objects fit into
[quoted text clipped - 5 lines]
> train2 to speed up. have not been able to reference get name of train from
> vector only that it is a train object - then i want to say train2.speedUp().

The vector that define the track path, I assume it hold something like x,y
points?

Why not have train1 just ask the ControlCenter object for a reference to
train2 so you can message it directly?

> is this a fair model. i thought of using two dimensional vector to involve
> tracks which intersected.

I don't see that a 2-D array buys you much over the 1-D vector described
above.  You can still determine intersections with the 1-D and you'll save a
vast amount of memory.  There would be a lot of empty cells in the 2-D
approach.

> is there a more obvious model to choose - i have had jxta mentioned to me to
> use trains as peers - but have no experience of this.

No, JXTA would not be the correct approach to this.  JXTA would only be
useful if you had "trains" on different computers and you wanted them to be
able to find each other and communicate without a central controlling server.
That doesn't sound like your situation.

> thanks for any help
> mark

Signature

Bill Tschumy
Otherwise -- Austin, TX
http://www.otherwise.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.