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 09-18-2008
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default different simulation time by using different run speeds

Hi,

I build a small and simple model. a crane transport a flowitem from a source to a queue. all items will be placed to a zero z-position in the queue. the queue has a maximum content of 100 and uses the vertical stack option. Therefore I use a custom draw code at the properties window.

for (int i=1;i <= content(current); i++)
setloc(rank(current,i),1,-0.45,0);
return 1;

With a run speed below 300 all works fine.
With run speeds above 300 (e.g. 500) the simulation lasts longer.
It seems the model doesn't executes sometimes the custom draw code anymore and the flowitems are stacked to a vertical increasing column.

How can I place all items at a zero z-position with an unlimited runspeed, not using a custom draw code.

Joerg
  #2  
Old 09-18-2008
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

Hi Jörg,

In the queue change the Item Placement to Do Nothing, now you should only
see one item in the queue.

Lars-Olof
  #3  
Old 09-19-2008
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Hi Lars-Olof and ambitiuos flexsim users,

probably I didn't ask my question with the whole details, I should have. I'm sorry for that.
The standard option places the item in a vertical stack. This stack or column is in the centre of the queue. This is the same position my items should delivered to.

The queue itself controlls the placing and picking by a taskexecuter (TE) in the centre. Therefore there are existing two functions: pickoffset and placeoffset. I find that in the library tree. These functions are responsible for the behaviour of the TE and call another function: setlocation. All these function are depending from the draw code and they all work fine. But if I write my own code the described problem in the post above happens. It is a miracle for me that the simulation time is depending from the run speed.
The different simulation times occure also by changing the view angle und view position during the simulation and the same effect takes also place with a transporter.

The simpliest solution is to use two queues. the first queue gets the item transported by a taskexecuter. This queue has a maximum content of one. the second queue has the rest maximum content of the previous queue with the strange behaviour. But now I have to write new code to get the right statistic information. This is an approach I would avoid.

But the miracle exists further.


Jörg
Attached Files
File Type: zip MiracleSimulationTimes.zip (44.1 KB, 235 views)

Last edited by Jörg Vogel; 12-03-2014 at 02:03 AM. Reason: Reloading Attachement
  #4  
Old 09-19-2008
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

Hi Jörg,

The problem you have with is that Flexsim calculate the drop position from how many you have in the queue.
For example if you stack the item vertical and the item is 1 unit height, the first drop position is 1, the second is 2 etc.

I would remove your code in OnDraw and use Do Nothing on Item Placemnet.
I set the location for the item in OnEntry and I also have changed the queue placement
using Edit under Properties for the queue.

See attached model.

Hope this gives you some ideas.

Lars-Olof
Attached Files
File Type: zip MiracleSimulationTimes2.zip (40.5 KB, 234 views)
The Following 2 Users Say Thank You to Lars-Olof Leven For This Useful Post:
RalfGruber (09-19-2008)
  #5  
Old 09-19-2008
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

The danger of doing result relevant calculations (in your case the position of the items) in CustomDraw code is that you never know exactly, when it will be executed, especially with high simulation run speeds.
So you should only put animation relevant code into the CustomDraw trigger which doesn´t have any impact on simulation results and leave everything leading into results on triggers which will be fired at well defined points of time...
e.g.: using "updatekinematics" in the CustomDraw trigger leads to updating an objects position with every screenrefresh, but doesn´t change the calculation of the objects position itself.
But if you need the objects position for a calculation e.g. in OnEntry, you should call "updatekinematics" in that code right before you start to get location information from the object because you don´t know, when CustomDraw has been called the last time.

Best regards

Ralf aka ralle
The Following 2 Users Say Thank You to RalfGruber For This Useful Post:
Tom David (09-19-2008)
  #6  
Old 09-19-2008
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

"Therefore there are existing two functions: pickoffset and placeoffset. I find that in the library tree. These functions are responsible for the behaviour of the TE and call another function: setlocation. All these function are depending from the draw code and they all work fine." - Jörg Vogel

Jörg,

None of the objects in the library rely on the draw code for their calculations. Flexsim will run a regular model with regular library objects doing regular things with all the windows closed just fine. OnDraw only gets called if there is a window open to paint. It gets called less on higher run speeds because your cpu is busy calculating simulation results instead of busy calculating paint messages.
The Following User Says Thank You to Phil BoBo For This Useful Post:
Jörg Vogel (09-19-2008)


Thread Thread Starter Forum Replies Last Post
Displaying the simulation time with the various date/time formats. Regan Blackett Tips and Tricks 12 11-12-2012 08:01 AM
Inter Arrival Time by Time of Day Mod Brandon Peterson Tips and Tricks 0 04-23-2008 11:13 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.