FlexSim Community Forum

FlexSim Community Forum (https://archive.flexsim.com/index.php)
-   Q&A (https://archive.flexsim.com/forumdisplay.php?f=66)
-   -   which is better way To deal with this problem? (https://archive.flexsim.com/showthread.php?t=1356)

LINWEIXU 05-20-2010 11:55 PM

which is better way To deal with this problem?
 
if i want to change the length of item dynamically In a period of time.
the first way , i can senddelaymessage in a short time (for example 0.25s)to change the the length of item In that period of time.

the second way, i can use custom draw code to to change the length of item by simlation time

i think the second one is better,because message is event.but other people do not agree .
so i want to know which a higher efficiency for run speed

Jason Lightfoot 05-21-2010 03:20 AM

Without context this is hard to answer as there may be other things I'd worry about, for example if you're changing the length of an item as it travels down a conveyor . However generally I think I'd say the following:

You shouldn't really depend on the draw code for anything, since you may want to run with no views open for speed - and in this case the draw code will not be called. OnDraw would still be useful for watching something expand in size as a function of time with the view open. You can calculate the size as a simple linear function or even use kinematics to create a more complex progression over time.

You would normally create an event/message for the end of the expansion/contraction where you set the size, and use draw code to draw it smoothly between the start and finish event.

If the resizing is part of a process that can be interrupted (failure or preemption) then I'd consider using a BasicFR for the process since it can detect the stop and pause a kinematic or adjust your manual calculation.

Another option for objects, if the resizing is independant of any other events, is to use the new animator feature in version 5.


All times are GMT -6. The time now is 04:33 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.