question

Raashid Mohammed avatar image
1 Like"
Raashid Mohammed asked Joerg Vogel answered

can we have delay time on Network Node

Hi

I would like to know if there is a way to add delay time to network node so that transporter arrives to the node waits for certain distribution time before it continues

Thank You

FlexSim 16.0.1
network nodes
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Sam Stubbs avatar image
6 Likes"
Sam Stubbs answered Joerg Vogel commented

I was able to create a delay using the following:

Open up the Network Node properties by double clicking on it, and go to the Triggers tab.

Under the OnContinue trigger, add some custom code (the little scroll icon) Enter the following code under the other stuff in there.

stopobject(traveler, STATE_SUSPEND);
senddelayedmessage(current,10,traveler);

This tells the node too stop whatever object is travelling through that node in a suspended state. Then it sends a delayed message from the traveler to the node, (with the second parameter being the time delay, 10 time units in this example.)

Then under the OnMessage trigger, add this custom code:

resumeobject(msgsendingobject());

This lets the node know when it receives the delayed message to then allow the travelling object to resume.


· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Lincoln Sellers avatar image Lincoln Sellers commented ·

@Adrian Haws

This does work visually in my model, but when I put in this code I get this error message every time there is a delay on a node:

createvent: event time is in past: event time changed to present. Object: NN4 advancetime: -21.851197, time: 21.851197 createvent: event time is in past: event time changed to present. Object: NN4 advancetime: -21.851197, time: 21.851197 To NN5

Is there any way to fix this error message, or another way to delay at a node without getting an error message? (The error message eventually crashes my whole model by a "throwing exception" error.)

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel commented ·

Maybe I am totally wrong, but I think the command stopobject creates internally a preempting tasksequence. That puts the taskexecuter offset from the network and on resume the traveler goes offset to the next Network Node. He is no longer on the network.

0 Likes 0 ·
Adrian Haws avatar image
2 Likes"
Adrian Haws answered Phil BoBo converted comment to answer

This may or may not apply to your specific model, but another way to manipulate travel and speeds on a network is with the Traffic Control resource. In its properties under the Speeds tab you can specify a change in speed based on an increase in content within the given area (in this image the speed decreases to 80% of normal when the content increases to 2).

This process also facilitates restrictions on number of Task Executers within the specified area.


5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

The approach of @Adrian Haws is a good one, but you can deny the traveler the use of edges by command, too. After a delay, created by a send message, you can grant the use of the edge again. Thread to deny and grant access to traffic controlled area.That is in my opinion the only way to delay a travel for a specific taskexecuter or a taskexecuter class. The stopobject command inherits the preempting tasksequence which places the taskexecuter offset from the network nodes. Generally you can close and open edges in the network, but with this approach you cancel the whole traffic on it.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.