ATTENTIONThis 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 |
#1
|
|||
|
|||
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. |
#4
|
|||
|
|||
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
|
||||
|
||||
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
|
||||
|
||||
Hello Eric,
Quote:
Jörg |
#7
|
||||
|
||||
Hello Alan,
Quote:
"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
|
||||
|
||||
Quote:
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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 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)); |
The Following User Says Thank You to Jörg Vogel For This Useful Post: | ||
Carsten Seehafer (01-09-2014) |
#16
|
||||
|
||||
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 |