I'm trying to make a simple traffic intersection control by traffic litght. But I dont know how to control the times. I think it will be necessary use Time Table, im trying but not successful.
I'm trying to make a simple traffic intersection control by traffic litght. But I dont know how to control the times. I think it will be necessary use Time Table, im trying but not successful.
I notice that your FlexSim license expired over 2 years ago. The first thing you should do is contact your local distributor in Brazil and get the latest version of FlexSim. Although we try and support all versions of FlexSim, it is not practical to try and do something in an older version that may be easier in the latest version of FlexSim. But if you have created a model that we can look at, that would make it easier for us.
Have you tried closing and opening node edges to stop traffic? You could use a User Event, that is timed, to send a message to an object and open/close the appropriate node edges.
Thanks a lot for answer. I've try every mode close and open nodes. I'm working now with a extra processor than utilize global variables to use with time process.
I'm using 3 variables: 1º time, 2º time and Flag (to sinalizate wich open). It's work, but too complicate to see that.
Thanks..
Not sure what you mean by it being "too complicated to see that"?
You can customize the Traffic Control object's logic by writing code in its OnEntryRequest trigger and using the trafficcontrolinfo() command:
Thus, you could write custom logic that keeps track of which lanes are open on labels and change those values based on time like a traffic light.
@phil.bobo would it be possible for you to provide an example or example code related to the above commands. For example, a 3 lane roadway whose light would turn red every 10 minutes and stay red for 40 seconds. Thanks in advance, Drew.
The attached model shows you how to do this. You can set the labels timeRed and timeGreen on the traffic control to control how long it is red vs green.
The On Reset and On Message triggers control whether the state label is 1 or 0 (red or green).
The On Entry Request trigger checks the state label and returns TC_ON_ENTRY_REQUEST_QUEUE if the light is red and TC_ON_ENTRY_REQUEST_ALLOW if the light is green.
In the On Message, when the light turns green, it calls the following code to release any requests that are currently pending:
int numWaiting = trafficcontrolinfo(current, TCI_NR_ENTRY_REQUESTS); for (int i = numWaiting; i >= 1; i--) { trafficcontrolinfo(current, TCI_ALLOW_ENTRY, i); }
8 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved