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 05-20-2009
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default Support_ModifyNetworkDuringSimulation_TD

Support_ModifyNetworkDuringSimulation_TD

This model is a small example how to change the network for a taskexecuter during the simulation run.

The first item gets released in the Source. To release the next item press the Release Item Button on the Control GUI.

Release Item = Releases an item from the Source (Message send to Source).
Init Network = Init the Network to 4 network nodes (User Command).
Add NetNode = Adds Network Node NN5 and makes the connections (User Command).

The idea is to give the taskexecuter the first tasksequence and if he is traveling to the NN2, press the AddNetNode to add an additional Network Node.
The tricky bit is to know, which commands are necessary to update the network sytem.
optimizenetwork() is to cause the model's network navigator to regenerate its distance table.

But it looks like that there is also something done during pressing the Reset button.
The distance table seems to be updated during pressing Reset.

So in the moment the taskexecuter travels to the Network Node NN 3 and stops. This was the last Network Node of the old network system.
It's seems, that the distance table is not updated during the simulation run.

So the big question is what else needs to be done to make the model working?


That’s now my question for the community. Any help and hints are appreciated. Maybe someone already solved this little puzzle.

P.S.: Is it also possible to get the code a taskexecuter is using the find the shortest way through the network? I know, that the Dijkstra's algorithm is used (http://www.flexsim.com/community/for...read.php?t=258). Is the code a secret or is it just because it is maybe C code and not Flexscript that it is hidden?
Would it be possible to make a model with an own algorithm with not to much effort?
Attached Files
File Type: zip Support_ModifyNetworkDuringSimulation_TD.zip (48.7 KB, 240 views)
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
The Following User Says Thank You to Tom David For This Useful Post:
RalfGruber (05-20-2009)
  #2  
Old 07-05-2010
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

I started this thread a year ago, but never got a reply.
It looks like that it is not an easy question.
Now I get the same questions again, so I like to ask here again.

Is it possible to modify a network during the simulation run?

I updated the model to v5.04 and attach it that it hopefully gets clear, what I am trying to do.

If anyone has ideas, suggestion or can give any help, I really appreciate it.
Attached Files
File Type: zip Support_ModifyNetworkDuringSimulation_TD.zip (30.7 KB, 147 views)
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
  #3  
Old 07-05-2010
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

Tom, I updated the AddNetworkNode_TD user command with the following, which solves your problem:

Code:
treenode connection=first(connectionsout(node("/NN5",model())));
while (objectexists(connection)){
	set(rank(connection,PORT_INOPEN),1);
	set(rank(tonode(get(connection)),PORT_INOPEN),1);
	connection=next(connection);
}
Attached Files
File Type: zip Support_ModifyNetworkDuringSimulation_TD_JL.zip (32.5 KB, 139 views)

Last edited by Jason Lightfoot; 07-05-2010 at 10:16 AM.
The Following 3 Users Say Thank You to Jason Lightfoot For This Useful Post:
Vincent Bechard (09-03-2010)
  #4  
Old 07-05-2010
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

I just wanted to add that in the following post I used network nodes for my example. So the last part of your question I think you could use that to decide your route - which could be the quickest (vehicle speed vs. path speed limit), least cost (tolls, or incline?) or some other function.

The post:
http://www.flexsim.com/community/for...ead.php?t=1246

Here's a direct link to the model:
http://www.flexsim.com/community/for...7"margin-top: 10px" align="right">
  #5  
Old 07-05-2010
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

Jason,

First of all thank you very much for your help. It is working, which is just great.

If I understand it right what was missing was that the in open of the connectionsout was not set to 1. And this was not visible from the outside. I learned a lot about the NetworkNodes and the connections. Good job, Jason!

I made the Support Model a Sample Model and posted it in the Download Section that this information and knowledge is stored somewhere. I refer to this thread, that everybody can see that you supported me and get the credits for it.

As I said my post was over a year old, there have been still the questions about the algorithm. I read the thread you refer to in your second post when you posted it and also had a look into the model. I found them quite interesting and they gave the answers. Thanks for this thread and the model.

Here is a link to the model in the Download Section:

Sample_ModifyNetworkDuringSimulation_TD
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
The Following User Says Thank You to Tom David For This Useful Post:
Esther Bennett (07-06-2010)

Tags
find route, find way, network node, network system



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.