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 02-29-2012
ericdaoust ericdaoust is offline
Flexsim User
 
Join Date: Nov 2011
Location: Sudbury, Ontario, Canada
Posts: 13
Downloads: 6
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 103
ericdaoust is on a distinguished road
Default Customize reset to not delete flowitems

Is there a way to customize my model's reset function so that my flowitems are not deleted when I hit the reset button or call the resetmodel() function? My model is an ore body that is constructed using boxes and would like to not have them deleted by the reset.

Note: I have modified the reset function of the model but it appears that this code is simply executed alongside the pre-existing reset function.

Thanks.
  #2  
Old 02-29-2012
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

Remove the itemtype node from your boxes.
The Following User Says Thank You to Phil BoBo For This Useful Post:
ericdaoust (02-29-2012)
  #3  
Old 02-29-2012
ericdaoust ericdaoust is offline
Flexsim User
 
Join Date: Nov 2011
Location: Sudbury, Ontario, Canada
Posts: 13
Downloads: 6
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 103
ericdaoust is on a distinguished road
Default

Thanks, that was exactly what I needed!
  #4  
Old 03-01-2012
ericdaoust ericdaoust is offline
Flexsim User
 
Join Date: Nov 2011
Location: Sudbury, Ontario, Canada
Posts: 13
Downloads: 6
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 103
ericdaoust is on a distinguished road
Default

I discovered another problem. Some of my blocks are inserted into a rack for indexing purposes. Removing the itemtype node is not sufficient in this case, likely because the rack clears its contents. How would I avoid having the rack clear its contents on reset?
  #5  
Old 09-28-2013
AlanZhang's Avatar
AlanZhang AlanZhang is offline
Flexsim Super Moderator
 
Join Date: Aug 2007
Location: CA
Posts: 289
Downloads: 64
Uploads: 0
Thanks: 88
Thanked 91 Times in 47 Posts
Rep Power: 225
AlanZhang is a jewel in the roughAlanZhang is a jewel in the roughAlanZhang is a jewel in the rough
Default

Phil,

How do I remove the itemtype node when a user click on Reset?

I put the code into OnModelReset trigger. But when I click on Reset. The flowitem is already gone before my code is executed.

Thanks,
Alan
__________________
Best,
Alan
  #6  
Old 09-29-2013
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

Hello Eric,

Quote:
Originally Posted by ericdaoust View Post
I discovered another problem. Some of my blocks are inserted into a rack for indexing purposes. Removing the itemtype node is not sufficient in this case, likely because the rack clears its contents. How would I avoid having the rack clear its contents on reset?
you can transfer the item node to the visual node drawsurrogate OnEntry trigger. You have to insert this node on your own in the visual node. It is missing in the rack tree. Then the items are not destroyed in the rack anymore, but the statistic and contenttables are still reset. You can store the data in another node and restore them on reset back to the rack tree. The last method might work for the items,too, if you do not transfer them to the drawsurrogate node.

Jörg
  #7  
Old 09-29-2013
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

Hello Alan,
Quote:
Originally Posted by AlanZhang View Post
How do I remove the itemtype node when a user click on Reset?

I put the code into OnModelReset trigger. But when I click on Reset. The flowitem is already gone before my code is executed.
perhaps you choose two other function triggers to execute your code:
"On Run Stop" and "On Run Start".
And it is not necessary to remove the itemtype node. It is Probably better just to rename the node. The data is not destroyed and you activate the item functionality later again by renaming the node back.

Jörg
The Following User Says Thank You to Jörg Vogel For This Useful Post:
AlanZhang (09-29-2013)
  #8  
Old 09-29-2013
AlanZhang's Avatar
AlanZhang AlanZhang is offline
Flexsim Super Moderator
 
Join Date: Aug 2007
Location: CA
Posts: 289
Downloads: 64
Uploads: 0
Thanks: 88
Thanked 91 Times in 47 Posts
Rep Power: 225
AlanZhang is a jewel in the roughAlanZhang is a jewel in the roughAlanZhang is a jewel in the rough
Default

Quote:
Originally Posted by Jörg Vogel View Post
Hello Alan,

perhaps you choose two other function triggers to execute your code:
"On Run Stop" and "On Run Start".
And it is not necessary to remove the itemtype node. It is Probably better just to rename the node. The data is not destroyed and you activate the item functionality later again by renaming the node back.

Jörg
Jorg,

Thanks very much for your suggestion.

I did try that. In order to complete this, I need to rename the itemtype in OnRunStop (luckily it is automatically called when Reset button is clicked). But I also need to rename it back to itemtype in OnRunStart. I have to clear all these nodes in OnModelReset as well. Otherwise, I will get more and more the renamed itemtype node everytime when I run the model. The method is almost working except if you do not hit Reset before you save the model, all flowitem will still be gone.

I personally does not like the solution of using OnRunStop and OnRunStart as it makes things so complicated. I have to do quite a few experiments to figure out the relationship between OnRunStop and OnRunStart, OnModelReset etc. as I could not find the documentation for the call sequence of these triggers. I also tried using UserEvent OnReset, the model object's OnReset etc. None of them works as I want.

I guess what we really need here is to have a trigger which will be fired right before the default FlexSim logic (such as destroying all flowitems) is executed. Maybe FlexSim already have one?

Thanks,
Alan
__________________
Best,
Alan
  #9  
Old 09-30-2013
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

If you don't want the object to be destroyed on reset, just don't give the object an itemtype attribute to begin with. You don't need to dynamically add or remove the itemtype attribute. Just don't use it at all.

What are you actually trying to do, Alan?
  #10  
Old 10-02-2013
AlanZhang's Avatar
AlanZhang AlanZhang is offline
Flexsim Super Moderator
 
Join Date: Aug 2007
Location: CA
Posts: 289
Downloads: 64
Uploads: 0
Thanks: 88
Thanked 91 Times in 47 Posts
Rep Power: 225
AlanZhang is a jewel in the roughAlanZhang is a jewel in the roughAlanZhang is a jewel in the rough
Default

Hi Phil,

I am trying to send a gang truck from the quay to a scanner (Radiation Monitoring Portal), before it travels to a block. I use a queue connected to a processor to represent a scanner. Then I insert a task for a gang truck to travel to the queue and unload itself into the queue. Then the truck will follow the connection entering into the processor. After finish the process, the truck will continue to travel to the block and finish its loading or unloading task.

Everything seems working except once the truck passes the queue and the processor, it will become an flowitem (the itemtype attribute is automatically created by FlexSim). Then once the Reset is clicked, all gang trucks will be gone.

Thanks,
Alan
__________________
Best,
Alan
  #11  
Old 10-03-2013
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Hi Alan, why don't you use tasksequence completely for the scanning operation?
That way there is no problem with the automatic creation of the itemtype attribute.


Steven
The Following 3 Users Say Thank You to Steven Hamoen For This Useful Post:
Phil BoBo (10-03-2013)
  #12  
Old 10-03-2013
AlanZhang's Avatar
AlanZhang AlanZhang is offline
Flexsim Super Moderator
 
Join Date: Aug 2007
Location: CA
Posts: 289
Downloads: 64
Uploads: 0
Thanks: 88
Thanked 91 Times in 47 Posts
Rep Power: 225
AlanZhang is a jewel in the roughAlanZhang is a jewel in the roughAlanZhang is a jewel in the rough
Default

Steven,

Thanks for your advice.

This modeling task is for a question asked by a FlexTerm (or FlexSim CT) end-user. I would like to make coding as little as possible. Besides there are different types of trucks, possibly different routes, multiple lanes, multiple scanners, requesting operators etc. Using tasksequence to reproduce what a standard queue or a processor can do seems a complicated task by itself. All those can be done by using standard FlexSim interface and parameters are easily to be adjusted. Everything seems perfect expect the Reset.

Alan
__________________
Best,
Alan
  #13  
Old 10-03-2013
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

Sounds to me like your trying to remove the itemtype is more code than using task sequences.

To model a scanner, I wouldn't use a processor. I would try using a network node, and creating a task sequence for them to go to that node and then delay for a period. Then use non-passing paths and set "maximum travelers at node" to 1. The trucks should then queue up along the path before getting to the node and delaying for the process time.

You can put a dummy processor above the node to make it look like a scanner 3d shape at that node.

(I'm not sure if this would work perfectly as I haven't tested it, but that's what I'd try.)
The Following 4 Users Say Thank You to Phil BoBo For This Useful Post:
Steven Hamoen (10-03-2013)
  #14  
Old 10-03-2013
AlanZhang's Avatar
AlanZhang AlanZhang is offline
Flexsim Super Moderator
 
Join Date: Aug 2007
Location: CA
Posts: 289
Downloads: 64
Uploads: 0
Thanks: 88
Thanked 91 Times in 47 Posts
Rep Power: 225
AlanZhang is a jewel in the roughAlanZhang is a jewel in the roughAlanZhang is a jewel in the rough
Default

Phil,

Thanks for the suggestion. Using tasksequence is another solution. I think it is just requiring more work. Other than those things that I mentioned, you will need to worry about collecting statistics as well.

Is it possible for FlexSim to provide a Reset trigger which is for cleaning up of the last run (to fire before FlexSim do its default onreset logic), in addition to the existing Reset trigger which basically is for preparing the next run to fire after FlexSim do its default onreset logic)? If so, my problem here will be easily solved.

Alan
__________________
Best,
Alan
  #15  
Old 01-08-2014
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,

it seems this method is not working anymore in Flexsim 7.0.4 and 7.0.2 to let stay flowitems in the model
Quote:
Originally Posted by Phil BoBo View Post
Remove the itemtype node from your boxes.
Models of previous versions are still working, if the Flowitem has been placed in the previous version and the itemtype node has been removed there.
So the old robot libraries will probably work. The Flexsim 7 engine destroys only new created Flowitems.

I use the following source code in a OnExit-Trigger of a Queue
Code:
moveobject(item,model());
setloc(item,0,0,1);
destroyobject(node(">/1",item));
Jörg
The Following User Says Thank You to Jörg Vogel For This Useful Post:
Carsten Seehafer (01-09-2014)
  #16  
Old 01-08-2014
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

The destruction of items is now controlled by a flag on the node instead of the itemtype node. This prevents objects with a label called "itemtype" from getting destroyed.

The command to get/set whether an item is destroyed on reset is switch_destroyonreset()
The Following 7 Users Say Thank You to Phil BoBo For This Useful Post:
Tom David (01-09-2014)


Thread Thread Starter Forum Replies Last Post
Create Copy and Delete Nischith Kashyap Q&A 1 05-31-2011 02:48 AM
When I want to delete the connection of 'D' key generattion. syseo Container Terminal (CT) Library 1 01-19-2011 08:05 AM
create flowitems on reset in queue Congshi Wang Q&A 1 12-22-2010 10:58 AM
It's possible customize the containers? Flavio Brito Container Terminal (CT) Library 0 03-12-2010 08:45 AM
Using TE FlowItems to Transport other FlowItems juan alberto Q&A 13 09-13-2009 09:00 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.