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 07-31-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default one question about custom draw code trigger

whether custom draw code trigger fire every time?
i write code pf(time); pr(); in draw code trigger .
Outcomeaccording to simulation velocity.
if i have some code which run every time,which trigger i write code ?
  #2  
Old 07-31-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

It is against the discrete event idea to fire a trigger every time unit.
And it makes a simulation run slow.
Only at events something will change in your model, so why have an event every time?
If you still want to have an event every time, you could use a UserEvent which gets repeated.

One side note: Why do you write your post with blue color and underline? It makes then more difficult to read. And if you ask specific people for an answer, you might not get one. A community is more a place where everybody helps everybody. So I would not limit this to special persons.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
  #3  
Old 07-31-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

sorry it's my fault,my English is poor ,often trun to dictionary, i copy it so with blue color and underline.
sometimes,you can Realizing complex logic in one place,so there are some event you don't konw what time it happend,especial some conditon ,so you must check it every time,every time can be every second,Precision depend on your model.it is called"Centralized control distributed simulation",i used to use extendsim it can realize this function.so i think flexsim also can do it.
can you give me answer about first question?

Last edited by Tom David; 08-06-2009 at 01:37 AM. Reason: Useless Quote
  #4  
Old 07-31-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

Again, it is against Discrete Event Simulation if you use e.g. conditions like time() == 500. If you do not have an event at time 500 the condition will never be true. If you use time() >= 500 and one event is at time 400 and the next at time 700, your condition will become true at time 700.
If you use a user event at time 700 then you have your event at he exact time.

The custom draw code is fired very often, because it is like a Screen Refresh. I guess it is something like 24 times per second. If you increase the run speed, it will get fired less, I guess, but still every time unit? I don't know. But if you click in an ortho view, the custom draw code will fire.
So in this sense it will get fired more often than every time unit.

Like said, if you need a kind of a ticker you could use a user event which is fired every second. But this will slow down your model.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
  #5  
Old 08-01-2009
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 agree with Tom's answers.

For debugging purposes, you might also want to look at the following thread which will allow you to execute centralised code on an event basis. The expression allows you to select which events cause the 'action' code to fire. Like Tom says, I still wouldn't recommended this for controlling model behaviour as it is evaluated on every event.

http://www.flexsim.com/community/for...=4611#post4611

Note the action code will only fire when the value of the expression changes

Last edited by Jason Lightfoot; 08-01-2009 at 06:38 AM.
  #6  
Old 08-03-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

thanks Jason Lightfoot


Thread Thread Starter Forum Replies Last Post
draw network nodes using data from an excel sheet Vinay Mehendiratta Q&A 7 10-14-2014 08:40 AM
Setting Custom State Francois Perron Q&A 1 04-06-2009 02:37 AM
can't move objects and draw lines Martin Bendig Q&A 2 01-13-2009 05:39 AM
Forklift with custom fork 3D object. Anthony Johnson Tips and Tricks 0 07-09-2008 12:22 PM
New custom commands in Downloads link Cliff King Q&A 0 09-24-2007 05:46 PM


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.