ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
|
Downloads |
Flexsim Student Forum Forum for discussion for Flexsim Students using the Flexsim Textbook. |
#1
|
|||
|
|||
Question about Traffic Light with conveyor
I have a tram model in Yogyakarta, Indonesia with FlexSim 5 for my final thesis. Conveyor is used to be a rail in this model. My model is modified model from Roller-coaster example model. And, my question is \"how I input Traffic Light within conveyor?\".
I want to download Highway Traffic example model on download link in this forum but it cannot be accessed anyway. And, I attach my model, unfinished model. Regards, Adhyaksa Bagaskara Undergraduate student from Universitas Gadjah Mada |
#2
|
||||
|
||||
Hi,
You can use the traffic control object for controlling the flow within the conveyors.You can also use other commands like closeoutput along with openoutput or stopobject and resumeobject in the conveyors depending upon the content of downstream conveyors. Last edited by sagar bolisetti; 01-07-2015 at 09:29 AM. |
The Following User Says Thank You to sagar bolisetti For This Useful Post: | ||
Adhyaksa Bagaskara (01-13-2015) |
#3
|
||||
|
||||
Hello Adhyaksa,
the conveyor is based on the Basic Conveyor Object. It isn't a member of the taskexecuter class. Therefore you cannot use the traffic control object on items traveling on the conveyor. But you can create a traffic control method with the decision points and the command bcsetitemconveystate(...). If the target speed cannot be set to zero then you can set the target speed to very slow value. That is not accurate but in most cases it will work with a little deviation in the statistical results. Jörg |
The Following 3 Users Say Thank You to Jörg Vogel For This Useful Post: | ||
sagar bolisetti (01-09-2015) |
#4
|
||||
|
||||
Dear Adhyaksa,
Adding on to Mr Jorg Vogel's post.I am attaching the Highway Traffic Model with this post, by studying this model you will get better ideas for solving your problem. Regards, Arun KR |
The Following 2 Users Say Thank You to arunkrmahadeva For This Useful Post: | ||
Jörg Vogel (01-08-2015) |
#5
|
|||
|
|||
Thank you very much Mr. Sagar Bolisetti, Mr. Jorg Vogel, and Mr. Arunkrmahadeva for your answers.
I have same idea with Mr. Jörg Vogel to use decision point because the conveyor in my model is BasicConveyor. But, I have one question again. How to fit traffic light time in flexsim? I know the concept using bcsetitemconveystate. Or maybe the answer is using C++? Thank you everyone for your attention. Regards, Adhyaksa Bagaskara |
#6
|
|||
|
|||
Reply
Thank you very much Mr. Sagar Bolisetti, Mr. Jorg Vogel, and Mr. Arunkrmahadeva for your answers.
I have same idea with Mr. Jörg Vogel to use decision point because the conveyor in my model is BasicConveyor. But, I have one question again. How to fit traffic light time in flexsim? I know the concept using bcsetitemconveystate. Or maybe the answer is using C++? Thank you everyone for your attention. Regards, Adhyaksa Bagaskara |
#7
|
||||
|
||||
You just need another event when the traffic light changes its state. You can send a delayed message and in the receiving object's OnMessage trigger you change the bcsetitemconveystate. If you have a static frequence in your traffic light system, you can compare the lasting state with the current run time before you compute the delay time of the message. The change in the traffic light system can you set with repeated user events.
Jörg |
The Following 2 Users Say Thank You to Jörg Vogel For This Useful Post: | ||
Carsten Seehafer (01-15-2015) |
#8
|
|||
|
|||
Some question again
Thank you Mr. Jörg Vogel for your answer again. I have an idea using command stopobject(). I implement that method to stop tram with decision point onCover.
And there is a question with my idea. How i can resumeobject my tram with delayed time. I use /**Custom Code*/ treenode current = ownerobject(c); treenode item = parnode(1); int decisionpoint = parval(2); double position = parval(3); stopobject(current, STATE_BLOCKED); and then my tram is stopped. And I am confused to resumeobject my tram with 30 seconds (maybe) after I stopobject that. I am sorry I have many questions because FlexSim is too fun to study it and I am curious about Flexsim. Thank you very much. Regards, Adhyaksa Bagaskara a |
#9
|
||||
|
||||
Hi Adhyaksa
You should not use commands stopobject() and resumeobject() for the basic conveyor. If you want to stop a BasicConveyor, use bcsetitemconveystate() on all the items to stop them. If you want to restart a BasicConveyor, use bcsetitemconveystate() on all the items to restart them.The only difference is that you have to change the target speed value.Use a senddelayedmessage() for the 30 second delay between stopping and resuming.Replace 'item' with 'fromobject' when you send the message, and then in the on message trigger use 'msgsendingobject' where you want to refer to the item. Last edited by sagar bolisetti; 01-20-2015 at 11:19 AM. Reason: add sample model |
The Following 2 Users Say Thank You to sagar bolisetti For This Useful Post: | ||
Jörg Vogel (01-15-2015) |
#10
|
|||
|
|||
Good afternoon all. I am sorry that I have not replied your message.
I have a question for Sagar Bolisetti. I have applied the code from your Flexsim file. But, my model is not using output port. So, after the "tram" stay at decision point for 30 seconds, that "tram" is reset to start position. If you have any solution for this problem, I will thank you very much. I am still stuck at this point. |
#13
|
||||
|
||||
Hello Adhyaksa,
to the command bcsetitemconveystate belongs several parameters. One describes the starting position of the item you want to set. Probably you have set this value to zero or more likely the function returns zero. As you have done it, it is a good practice that this value is set to the last position on the conveyor. You use a command to evalute this position in the OnMessage trigger. But you can send this location already in the message telegram as a parameter. If there is a situation, that you want to test. Use several debug points in your message trigger or write relevant values to the output console from within the code. 2nd: At the precise photo eye you send a delayed message. As I described above you indeeed evaluate the second message parameter as the location on the conveyor. But you aren't sending this value. It isn't set. Jörg Last edited by Jörg Vogel; 02-23-2015 at 02:48 AM. Reason: write additional alternatives 2nd: research the model |
The Following 2 Users Say Thank You to Jörg Vogel For This Useful Post: | ||
sagar bolisetti (02-23-2015) |
#14
|
||||
|
||||
Traffic light "my way"
Hello,
One time ago, i did a model with flexsim that uses traffic ligth, i did an object in a custom library, that consist in a visual tool with a processor, a sink and a source this three objects inside of the visual tool, the source is conected to the processor and the processor to the sink, then the source send two tipe of items to the processor, one red, and one green, and the processor have a process time for each one, simulating the time of the traffic ligth, and when the processor finish, it send the item to the sink. the source is programed by sequence for repeat the change, green-red. then i made a reference connection from the processor to the street(in this case a conveyor like the X_high_Way model), an "S" connection, and in the "on entry trigger", i programed that when a type of itemtype go inside of it, it close and open the port of the street, by the case. I attach the compleete model, you can see it. |
The Following 2 Users Say Thank You to Zulay Sarmiento For This Useful Post: | ||
sagar bolisetti (02-24-2015) |
Tags |
conveyor, light, traffic, tram |
Thread | Thread Starter | Forum | Replies | Last Post |
Right of way in a traffic controlled area | Cristian Ramirez | Q&A | 2 | 11-13-2013 06:47 PM |
Traffic Controll | Uri Schtalheim | Q&A | 1 | 12-07-2011 10:58 AM |
How to use conveyor to build traffic flow simulation model | Thirapan Kangwansura | Q&A | 6 | 05-18-2010 11:40 PM |
Road traffic | mallik | Q&A | 3 | 09-25-2009 12:55 PM |
Modeling Traffic Flow | DavidStun | Pre-sales Questions | 2 | 03-11-2009 11:35 AM |