473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Creating traffic simulator with VB .NET

Dear Readers,

This is my first post to this group. I was pointed to this group in a
other vb group, so i have better luck here!

For my learning curve of VB .NET i want to make a traffic simulation
program. Before i start programming, i need to know if there even is a
possibility to make a algorithm in VB .NET that is able to let traffic
drive and making the lights go green, orange or red.

Thanks in advance,

Wouter van Teijlingen
Nov 21 '05 #1
26 5534

"Wouter van Teijlingen" <wo*****@nedlinux.nl> wrote
For my learning curve of VB .NET i want to make a traffic simulation
program. Before i start programming, i need to know if there even is a
possibility to make a algorithm in VB .NET that is able to let traffic
drive and making the lights go green, orange or red.

What sort of algorithm do you anticipate that may cause it trouble?
VB.Net is a programing language, after all....

LFS
Nov 21 '05 #2

"Wouter van Teijlingen" <wo*****@nedlinux.nl> wrote
For my learning curve of VB .NET i want to make a traffic simulation
program. Before i start programming, i need to know if there even is a
possibility to make a algorithm in VB .NET that is able to let traffic
drive and making the lights go green, orange or red.

What sort of algorithm do you anticipate that may cause it trouble?
VB.Net is a programing language, after all....

LFS
Nov 21 '05 #3
Wouter,

In addition to Larry, when you cannot do it with VBNet you probably cannot
do it with any programming language. Although there are languages which
better fit for special situations as deep in the operating system
programming and creating browser plugins.

I saw nedLinux in your email adress, there is a VBNet mono. Here we almost
all do VBNet microsoft (therefore is it a microsoft newsgroup). Most of us
don't know how VBNet in Mono is acting at the moment.

Just a little bit to get the traffic in the right direction.

Cor
Nov 21 '05 #4
Wouter,

In addition to Larry, when you cannot do it with VBNet you probably cannot
do it with any programming language. Although there are languages which
better fit for special situations as deep in the operating system
programming and creating browser plugins.

I saw nedLinux in your email adress, there is a VBNet mono. Here we almost
all do VBNet microsoft (therefore is it a microsoft newsgroup). Most of us
don't know how VBNet in Mono is acting at the moment.

Just a little bit to get the traffic in the right direction.

Cor
Nov 21 '05 #5
Ok. But is it possible to make something that you can control the
traffic lights with button. So i press green then the traffic will start
driving? I press red it will stop?

My email ends with nedlinux, but i'm really using VB .NET 2003 here :-)

Thanks,

Wouter van Teijlingen
The Netherlands
Nov 21 '05 #6
Ok. But is it possible to make something that you can control the
traffic lights with button. So i press green then the traffic will start
driving? I press red it will stop?

My email ends with nedlinux, but i'm really using VB .NET 2003 here :-)

Thanks,

Wouter van Teijlingen
The Netherlands
Nov 21 '05 #7
Wouter,

You can control the RS232 port if you are asking that.
Mostly is that answered by Dick Grier in this newsgroup.

When you make a message like "how can I do the traffic lights using the comm
port or RS232" he will probably answer you because in my idea has he some
kind of filter on that in his newsreader.

This is his homepage
http://www.hardandsoftware.net/

There is a lot on MSDN, I never did this kind of things however here a
sample.
http://msdn.microsoft.com/library/de...versamples.asp

I hope this helps?

Cor

Nov 21 '05 #8
Wouter,

You can control the RS232 port if you are asking that.
Mostly is that answered by Dick Grier in this newsgroup.

When you make a message like "how can I do the traffic lights using the comm
port or RS232" he will probably answer you because in my idea has he some
kind of filter on that in his newsreader.

This is his homepage
http://www.hardandsoftware.net/

There is a lot on MSDN, I never did this kind of things however here a
sample.
http://msdn.microsoft.com/library/de...versamples.asp

I hope this helps?

Cor

Nov 21 '05 #9
Cor Ligthert wrote:
Wouter,

You can control the RS232 port if you are asking that.
Mostly is that answered by Dick Grier in this newsgroup.

When you make a message like "how can I do the traffic lights using the comm
port or RS232" he will probably answer you because in my idea has he some
kind of filter on that in his newsreader.


That's not what i mean. It has to be software only. Imagine the following:

I have train. When the train passes the train passage has to close. The
''battle trees'' have to be closed until the train is away. I don't want
to combine this with hardware at all (only the computer).

So when i press the button GREEN cars can ride. When i press RED, when
train comes by, cars must stop. So the train must comeby, let's say,
every five minutes.

I hope this makes things better understandable. Thank you for your help.

Bye,

Wouter van Teijlingen

Nov 21 '05 #10
Cor Ligthert wrote:
Wouter,

You can control the RS232 port if you are asking that.
Mostly is that answered by Dick Grier in this newsgroup.

When you make a message like "how can I do the traffic lights using the comm
port or RS232" he will probably answer you because in my idea has he some
kind of filter on that in his newsreader.


That's not what i mean. It has to be software only. Imagine the following:

I have train. When the train passes the train passage has to close. The
''battle trees'' have to be closed until the train is away. I don't want
to combine this with hardware at all (only the computer).

So when i press the button GREEN cars can ride. When i press RED, when
train comes by, cars must stop. So the train must comeby, let's say,
every five minutes.

I hope this makes things better understandable. Thank you for your help.

Bye,

Wouter van Teijlingen

Nov 21 '05 #11
Cor Ligthert wrote:
Wouter,

You can control the RS232 port if you are asking that.
Mostly is that answered by Dick Grier in this newsgroup.

When you make a message like "how can I do the traffic lights using the comm
port or RS232" he will probably answer you because in my idea has he some
kind of filter on that in his newsreader.


That's not what i mean. It has to be software only. Imagine the following:

I have train. When the train passes the train passage has to close. The
''battle trees'' have to be closed until the train is away. I don't want
to combine this with hardware at all (only the computer).

So when i press the button GREEN cars can ride. When i press RED, when
train comes by, cars must stop. So the train must comeby, let's say,
every five minutes.

I hope this makes things better understandable. Thank you for your help.

Bye,

Wouter van Teijlingen

Nov 21 '05 #12
Cor Ligthert wrote:
Wouter,

You can control the RS232 port if you are asking that.
Mostly is that answered by Dick Grier in this newsgroup.

When you make a message like "how can I do the traffic lights using the comm
port or RS232" he will probably answer you because in my idea has he some
kind of filter on that in his newsreader.


That's not what i mean. It has to be software only. Imagine the following:

I have train. When the train passes the train passage has to close. The
''battle trees'' have to be closed until the train is away. I don't want
to combine this with hardware at all (only the computer).

So when i press the button GREEN cars can ride. When i press RED, when
train comes by, cars must stop. So the train must comeby, let's say,
every five minutes.

I hope this makes things better understandable. Thank you for your help.

Bye,

Wouter van Teijlingen

Nov 21 '05 #13
Wouter,

That was what I understood, however there should be an interface between
your train and your computer in my opinion.

Or is it completly without any fysical beside the computer and is it
simulating.

I saw this link in another newsgroup by the way.
http://msdn.microsoft.com/msdnmag/is...NETSerialComm/

This is with fysical, however I cannot keep it forever in my clipboard

:-)

Cor
Nov 21 '05 #14
Wouter,

That was what I understood, however there should be an interface between
your train and your computer in my opinion.

Or is it completly without any fysical beside the computer and is it
simulating.

I saw this link in another newsgroup by the way.
http://msdn.microsoft.com/msdnmag/is...NETSerialComm/

This is with fysical, however I cannot keep it forever in my clipboard

:-)

Cor
Nov 21 '05 #15
Cor Ligthert wrote:
Wouter,

That was what I understood, however there should be an interface between
your train and your computer in my opinion.

Or is it completly without any fysical beside the computer and is it
simulating.


I want to make the program without any fysical connection. It's all
simulated on the computer. The train is simulated on the computer, the
trafficlights and battle tree's. Just everything. I wondered if this was
possible to make in VB .NET.

-- Wouter van Teijlingen
Nov 21 '05 #16
Cor Ligthert wrote:
Wouter,

That was what I understood, however there should be an interface between
your train and your computer in my opinion.

Or is it completly without any fysical beside the computer and is it
simulating.


I want to make the program without any fysical connection. It's all
simulated on the computer. The train is simulated on the computer, the
trafficlights and battle tree's. Just everything. I wondered if this was
possible to make in VB .NET.

-- Wouter van Teijlingen
Nov 21 '05 #17
Wouter,

I would not know now why not.

However are you thinking about a complete graphical interface, than I would
ask this as well in the newsgroup

news//news.microsoft.public.dotnet.framework.drawing

And tell than about the graphics you need.

Cor
Nov 21 '05 #18
Wouter,

I would not know now why not.

However are you thinking about a complete graphical interface, than I would
ask this as well in the newsgroup

news//news.microsoft.public.dotnet.framework.drawing

And tell than about the graphics you need.

Cor
Nov 21 '05 #19
"Wouter van Teijlingen" <wo*****@nedlinux.nl> wrote in message
news:ct**********@reader08.wxs.nl...
Cor Ligthert wrote:
Wouter,

That was what I understood, however there should be an interface between
your train and your computer in my opinion.

Or is it completly without any fysical beside the computer and is it
simulating.


I want to make the program without any fysical connection. It's all
simulated on the computer. The train is simulated on the computer, the
trafficlights and battle tree's. Just everything. I wondered if this was
possible to make in VB .NET.

-- Wouter van Teijlingen


You can do it, but I think it'd be dead hard to do anything beyond trivial.
Not just in vb.net, in any language.

One road and one car would be kind of easy.
Say.
The car just goes left to right until it comes to the lights... then
reappears on the left of the picture.
The lights turn from red to amber to green....
The car stops if < so-many-pixels from the lights if they're red.
You can hard code all the tricky bits.
You need a car.jpg a background.jpg and three lights.jpg.
Or maybe one lights.jpg and you draw a green/red/amber bit on it.

More cars and more roads is hurting my head just thinking about it.

You're tallking the sort of programming that games designers do.
You need to think about collision detection between the cars.
How do the cars "know" which road they're on and where it goes.
How do they work out that there are lights ahead.
The algorithm woukd be really tricky.
I'm not exactly sure how games designers do this.
I think there's like a mathematical model they use controls the movement and
where stuff is and hence collision detection.
This model is then used by the graphics bits.
So the lights being green is (say) a Light_Colour property of that light
object the buncha-cars-on-that-road will check to see if they move. It's
also one of the properties the stuff does the graphics will check as it
decides which of three lights.jpg to stick in the picture.
You heave inheritance to make vehicles then cars/trucks inherit from that.

Simulation is hard though.
I would imagine the vast majority of us on this ng do business programming.
--
Regards,
Andy O'Neill
Nov 21 '05 #20
"Wouter van Teijlingen" <wo*****@nedlinux.nl> wrote in message
news:ct**********@reader08.wxs.nl...
Cor Ligthert wrote:
Wouter,

That was what I understood, however there should be an interface between
your train and your computer in my opinion.

Or is it completly without any fysical beside the computer and is it
simulating.


I want to make the program without any fysical connection. It's all
simulated on the computer. The train is simulated on the computer, the
trafficlights and battle tree's. Just everything. I wondered if this was
possible to make in VB .NET.

-- Wouter van Teijlingen


You can do it, but I think it'd be dead hard to do anything beyond trivial.
Not just in vb.net, in any language.

One road and one car would be kind of easy.
Say.
The car just goes left to right until it comes to the lights... then
reappears on the left of the picture.
The lights turn from red to amber to green....
The car stops if < so-many-pixels from the lights if they're red.
You can hard code all the tricky bits.
You need a car.jpg a background.jpg and three lights.jpg.
Or maybe one lights.jpg and you draw a green/red/amber bit on it.

More cars and more roads is hurting my head just thinking about it.

You're tallking the sort of programming that games designers do.
You need to think about collision detection between the cars.
How do the cars "know" which road they're on and where it goes.
How do they work out that there are lights ahead.
The algorithm woukd be really tricky.
I'm not exactly sure how games designers do this.
I think there's like a mathematical model they use controls the movement and
where stuff is and hence collision detection.
This model is then used by the graphics bits.
So the lights being green is (say) a Light_Colour property of that light
object the buncha-cars-on-that-road will check to see if they move. It's
also one of the properties the stuff does the graphics will check as it
decides which of three lights.jpg to stick in the picture.
You heave inheritance to make vehicles then cars/trucks inherit from that.

Simulation is hard though.
I would imagine the vast majority of us on this ng do business programming.
--
Regards,
Andy O'Neill
Nov 21 '05 #21
Cor Ligthert wrote:
Wouter,

I would not know now why not.

Okay, thanks.
Now i can take a time to start thinking about the how the program should
be made.

-- Wouter van Teijlingen

Nov 21 '05 #22
Cor Ligthert wrote:
Wouter,

I would not know now why not.

Okay, thanks.
Now i can take a time to start thinking about the how the program should
be made.

-- Wouter van Teijlingen

Nov 21 '05 #23

Andy O'Neill wrote:
You can do it, but I think it'd be dead hard to do anything beyond trivial.

I agree that the program he is describing will not be simple, VB.Net is
perfectly capable of doing complex programs.
One road and one car would be kind of easy.
Say.
The car just goes left to right until it comes to the lights... then
reappears on the left of the picture.
The lights turn from red to amber to green....
The car stops if < so-many-pixels from the lights if they're red.
You can hard code all the tricky bits.
You need a car.jpg a background.jpg and three lights.jpg.
Or maybe one lights.jpg and you draw a green/red/amber bit on it.

More cars and more roads is hurting my head just thinking about it.

You're tallking the sort of programming that games designers do.
You need to think about collision detection between the cars.
The cars behavior should not depend at all on the visual representation
on the screen. The car, the traffic light, the road, and all the other
items in the game would be defined as classes with separate properties.
The display on the screen would simply reflect the current state of
all the objects. Look up the Model - View - Controller design pattern.

How do the cars "know" which road they're on and where it goes.
How do they work out that there are lights ahead.
I'd imagine the network of roadways would be modelled with some sort of
graph structure. The cars would not have to know what is ahead, they
would just check to see if there is a light at their current location
and what it's state is (red, yellow, or green). Pick up a college
textbook on data structures. There is a lot of computer science theory
on graphs, trees, etc. that would be useful.
The algorithm woukd be really tricky.
I'm not exactly sure how games designers do this.
I think there's like a mathematical model they use controls the movement and where stuff is and hence collision detection.
This model is then used by the graphics bits.
The algorithm would certainly be challenging, but each object could be
written to be independent. The car for example would have properties
such as speed, direction, etc. When the simulation is started, the car
would operate pretty much independent of the other vehicles. If two
cars happened to enter the same location, that would constitue a
collision.

I'm not clear if the original poster is trying to create some sort of
game (like Sim City) or a traffic simulator to simulate the flow of
traffic.

Simulation is hard though.
I would imagine the vast majority of us on this ng do business

programming.

It's definitely an app that would require careful design, but VB.Net is
more than capable of handling it, IMHO.

Cheers,

Chris

Nov 21 '05 #24

Andy O'Neill wrote:
You can do it, but I think it'd be dead hard to do anything beyond trivial.

I agree that the program he is describing will not be simple, VB.Net is
perfectly capable of doing complex programs.
One road and one car would be kind of easy.
Say.
The car just goes left to right until it comes to the lights... then
reappears on the left of the picture.
The lights turn from red to amber to green....
The car stops if < so-many-pixels from the lights if they're red.
You can hard code all the tricky bits.
You need a car.jpg a background.jpg and three lights.jpg.
Or maybe one lights.jpg and you draw a green/red/amber bit on it.

More cars and more roads is hurting my head just thinking about it.

You're tallking the sort of programming that games designers do.
You need to think about collision detection between the cars.
The cars behavior should not depend at all on the visual representation
on the screen. The car, the traffic light, the road, and all the other
items in the game would be defined as classes with separate properties.
The display on the screen would simply reflect the current state of
all the objects. Look up the Model - View - Controller design pattern.

How do the cars "know" which road they're on and where it goes.
How do they work out that there are lights ahead.
I'd imagine the network of roadways would be modelled with some sort of
graph structure. The cars would not have to know what is ahead, they
would just check to see if there is a light at their current location
and what it's state is (red, yellow, or green). Pick up a college
textbook on data structures. There is a lot of computer science theory
on graphs, trees, etc. that would be useful.
The algorithm woukd be really tricky.
I'm not exactly sure how games designers do this.
I think there's like a mathematical model they use controls the movement and where stuff is and hence collision detection.
This model is then used by the graphics bits.
The algorithm would certainly be challenging, but each object could be
written to be independent. The car for example would have properties
such as speed, direction, etc. When the simulation is started, the car
would operate pretty much independent of the other vehicles. If two
cars happened to enter the same location, that would constitue a
collision.

I'm not clear if the original poster is trying to create some sort of
game (like Sim City) or a traffic simulator to simulate the flow of
traffic.

Simulation is hard though.
I would imagine the vast majority of us on this ng do business

programming.

It's definitely an app that would require careful design, but VB.Net is
more than capable of handling it, IMHO.

Cheers,

Chris

Nov 21 '05 #25
Chris Dunaway wrote:
....usefull information....

It's definitely an app that would require careful design, but VB.Net is
more than capable of handling it, IMHO.

Yes! Thanks for this very informative reaction. I have programming
experience in C++ so working with classes should not be a typical pain
in the ass :-).

I'm now busy with learning some specific syntax of vb (.net) and i
already like it. I like challenges so this will be great.

Thanks for the reactions,

-- Wouter van Teijlingen
Nov 21 '05 #26
Chris Dunaway wrote:
....usefull information....

It's definitely an app that would require careful design, but VB.Net is
more than capable of handling it, IMHO.

Yes! Thanks for this very informative reaction. I have programming
experience in C++ so working with classes should not be a typical pain
in the ass :-).

I'm now busy with learning some specific syntax of vb (.net) and i
already like it. I like challenges so this will be great.

Thanks for the reactions,

-- Wouter van Teijlingen
Nov 21 '05 #27

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Wouter van Teijlingen | last post by:
Dear Readers, For my learning curve of VB .NET i want to make a traffic simulation program. Before i start programming, i need to know if there even is a possibility to make a algorithm in VB...
0
by: Alex Vinokur | last post by:
C++ Simulator of a Universal Turing Machine can be downloaded at : * http://alexvn.freeservers.com/s1/utm.html * http://sourceforge.net/projects/turing-machine/ The program simulates a...
9
by: Milk | last post by:
Hi all, Can anyone help me to do this Question. Coz this is my first time study C++ language and my lecture want me to do this kind of program, i really don't have any ideal pls help me here...
61
by: /* frank */ | last post by:
I have to do a homework: make a CPU simulator using C language. I have a set of asm instructions so I have to write a program that should: - load .asm file - view .asm file - do a step by step...
0
by: SatishPasala | last post by:
Hi I am developing a Windows Mobile application. I want Visual Studio to use Palm Simulator to display the application. Now it is pointing to Default Simulator. I downloaded the Palm...
0
by: François | last post by:
Hi, My current job is to develop VoiceXML dialogs. The voice platform that we use provides neither a debugger nor a simulator, and each time I want to test a new dialog, I have to upload it on...
0
by: Killingkids | last post by:
hello, everyone...im facing a big problem in my final year project, hope that u all can help me solve the problem ... i was doing a mobile web application which enable student to check the college...
0
by: Killingkids | last post by:
hello, everyone...im facing a big problem in my final year project, hope that u all can help me solve the problem ... i was doing a mobile web application which enable student to check the college...
3
by: DanielJohnson | last post by:
I was wondering if anyblody can suggest me a network simulator written in python in which I can add on my own code and extend its functionality. I am looking for a simulator which will simualte...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.