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 03-15-2010
Gleny Rodriguez's Avatar
Gleny Rodriguez Gleny Rodriguez is offline
Flexsim User
 
Join Date: Jan 2010
Location: Honduras
Posts: 12
Downloads: 2
Uploads: 0
Thanks: 7
Thanked 2 Times in 2 Posts
Rep Power: 126
Gleny Rodriguez is on a distinguished road
Question Stopping automatically the simulation after set a Timetable or User Event

Hello All,
I created a timetable for a processor
One of the my model goal is to reach the the less time to process the products
But, the simulation is running after all the flowItem have gone away or finished,
I think it should stop just after the last flowitem is finished.
SomeOne has figure it out, How to make that the simulation stop automatically after the all flowitems have passed,Using TimeTable or User Events?
Thanks for the Help!
  #2  
Old 03-15-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 normally do it the way, that on the sink I compare the input of the sink with the number of items which will arrive in the system. Yes, I need to know, how many items will arrive in the system, but then the code is easy:

// IF INPUT IS GREATER EQUAL NUMBER OF ARRIVAL ITEMS
if(getinput(current) >= 23)
{
// SCREENREFRESH
repaintall();
// STOP SIMULATION RUN
stop();
}
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
  #3  
Old 03-15-2010
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,

One tip.

If you want Tom's code to work when using experimenter or not using the experimenter, replace stop() with endreplication(0).

Lars-Olof
  #4  
Old 03-15-2010
Gleny Rodriguez's Avatar
Gleny Rodriguez Gleny Rodriguez is offline
Flexsim User
 
Join Date: Jan 2010
Location: Honduras
Posts: 12
Downloads: 2
Uploads: 0
Thanks: 7
Thanked 2 Times in 2 Posts
Rep Power: 126
Gleny Rodriguez is on a distinguished road
Default

Thanks Tom / Lars
But a have some separators set in the model, and not all the products are splitted just a percentage, Ex: The source could have 100 flowitems but at the final sink could get 300.
That why I looking for other way to stop the simulation.
I was thinking on check if the object type FLOWITEM exist in the simulacion.
If I understand well, the FLOWITEM are destroy after they arrive into the sink.
but Quess what? I don't know how to do it.
Thanks for any help.
  #5  
Old 03-16-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

Gleny,

In my eyes your idea to check if there are objects FLOWITEM in the model is not really a good idea, because depending on your model size the search can be slow and therefore it will slow down your simulation run.
So I would not use it, but still to answer your question, you could do something with forobjecttreeunder(). See the manual to get the idea.

My idea would be to mark the last arriving item in your system by using a label and set this label to 1.
At the Sink OnEntry I would check for the label on the items. If this label is 1 it is the last item and I would stop the simulation run.
It is clear that you need to know which item is the last arriving item. I am pretty sure that you can get this information. If not, that you might go for the slow solution idea above.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
The Following 2 Users Say Thank You to Tom David For This Useful Post:
Sebastian Hemmann (03-16-2010)


Thread Thread Starter Forum Replies Last Post
Dynamically populate the timetable Gleny Rodriguez Q&A 1 03-10-2010 05:42 PM
User Event as Experimenter? ankus d Q&A 2 02-17-2009 08:06 AM
User Event firing - precision problems Shankar Narayan Q&A 6 02-16-2009 07:01 AM
Problem with user event Yasemin Vatandas Q&A 2 08-06-2008 02:49 AM
question about User Event Ning Wang Q&A 3 04-22-2008 10:56 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.