ATTENTION

This 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

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 06-25-2015
koenslootmans koenslootmans is offline
Flexsim User
 
Join Date: Jan 2013
Posts: 17
Downloads: 2
Uploads: 0
Thanks: 10
Thanked 4 Times in 2 Posts
Rep Power: 92
koenslootmans is on a distinguished road
Default Traffic controller issue when set TE to Queue by code on entryREquest

Hello ,

I'm experiencing the following problem.
When a certain type of TE is entering the TC area then the TC maxallowed gets set to 1. This will then make other TE wait to enter the area untill the other TE is out.

This works only partly, the next TE to enter the area will wait, however he will never enter the area not even when the first TE leaves the TC area, causing the TE to freeze. Other TE's that try to enter the area after the 1st TE is out have no problem to enter the aisle.
Do i need to record somewhere the guys that got put in queue to then trigger them to resend a request to enter the area at a point of time? and if so how do i do this?

I wrote the following code on the onentryrequest trigger of the traffic controller.

/**Custom Code*/
treenode traveler = parnode(2);
treenode TC = parnode(1);

treenode variable = getvarnode(TC, "maxactive");
int testvar = getvarnum(TC,"maxactive");


if(tonum(inobject(traveler,1)) == tonum(DispatcherSpareReplenishmentRucks) ) //is this one connected to the replenishment trucksDispatcher, if so we close the aisle for other traffic
{
treenode mylabel = getlabel(traveler,"CurrentAisleTC");
setnodenum(variable,1);
if(!objectexists(mylabel))
{
addlabel(traveler,"CurrentAisleTC");
}
setlabelnum(traveler, "CurrentAisleTC", tonum(TC));
return TC_ON_ENTRY_REQUEST_ALLOW; //means that this guy is not controlled by the traffic control (I put it to 0 when he finally enters the TC)
}
else if( testvar <= 1)
{
return TC_ON_ENTRY_REQUEST_QUEUE; //Just tried if this makes a different from default but it does not
}
else
{
return TC_ON_ENTRY_REQUEST_DEFAULT;
}
  #2  
Old 06-25-2015
koenslootmans koenslootmans is offline
Flexsim User
 
Join Date: Jan 2013
Posts: 17
Downloads: 2
Uploads: 0
Thanks: 10
Thanked 4 Times in 2 Posts
Rep Power: 92
koenslootmans is on a distinguished road
Default

I build a test model, in which i didn't change the onexit trigger of my TC (Wich i did modify in the other model) and this seems to be the reason why the TE's got stuck.

What should i put in the onexit trigger to let the TE's back into the model

at the left you see the example with the modified "onexit" trigger and on the right a solution without an onexit trigger...
Attached Files
File Type: fsm trafficcontrolissue.fsm (82.0 KB, 310 views)
  #3  
Old 06-25-2015
RalfGruber's Avatar
RalfGruber RalfGruber is offline
FlexSim Software Products
 
Join Date: Jul 2007
Location: Orem, UT, USA
Posts: 195
Downloads: 37
Uploads: 0
Thanks: 518
Thanked 294 Times in 124 Posts
Rep Power: 345
RalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to behold
Default

Koen,

you find all the information you need to allow a traveler into the controlled area if you look up the command "trafficcontrolinfo()" in the command help. Here is the specific one you are looking for, but go through all parameters explained in the user manual:

trafficcontrolinfo(tc, TCI_ALLOW_ENTRY, num requestnr) - Calling this command will instruct the traffic control to allow the traveler associated with the nth entry request to enter the traffic control area.

Good luck

Ralf
FlexSim
The Following User Says Thank You to RalfGruber For This Useful Post:
koenslootmans (06-25-2015)
  #4  
Old 06-25-2015
Kris Geisberger Kris Geisberger is offline
Flexsim Canada, Forum Moderator
 
Join Date: Aug 2007
Location: Canada
Posts: 209
Downloads: 54
Uploads: 1
Thanks: 99
Thanked 389 Times in 133 Posts
Rep Power: 451
Kris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud of
Default

Koen,

TC_ON_ENTRY_REQUEST_QUEUE indeed works, I have posted a model to your original thread that demonstrates its use.
https://www.flexsim.com/community/fo...ad.php?t=3089

Enjoy!

Tags
freezes, queue, traffic controller


Thread Thread Starter Forum Replies Last Post
Moving same itemtype to the next similar queue when current queue is full hendry teo Flexsim Student Forum 7 05-20-2015 06:26 AM
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
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


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.