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
|
||||
|
||||
ProcessFlow Questions
I'm working on my first processflow model and I'm getting close. I have a few more questions and they might be interesting for others out there as well so I ask them here:
1. I want to have a single number in a list. In this case the total pallets in circulation. So adding and subtracting from that list if they are used or new ones enter. I have solved it for now accoording the example with the Kanban labeler so if a load of new pallets arrive that token with the label is added to the list and I use a SELECT to take a pallet from the list. But is it also possible to add the value of a label to a single field/record on a list? Or is there a better approach to this problem? 2. On the same topic, if the value of my field gets below a certain value I need to reorder pallets. Is there a way to fire a trigger when certain values are reached on a list? 3. My model is not working 24/7 but only 16 hours for 5 days. Is there a way to use the timetables in the processflow? 4. Is there a simple way to show the time in a processflow view? That's it for now. I hope that somebody (probably from Flexsim;-) ) can help me! |
#2
|
||||
|
||||
Hello Steven,
4.) is easy to answer. Choose to Display Text: In the Field "Display Name" you select the code editor (black down arrow). Then add as code: Code:
return(time()); Code:
if (content(node("/Tools/GlobalLists/StoredPallets>variables/partitions/1/entries", model())) < 2) If the condition becomes true, then you create more Pallets in the model with the Create Object activity. Jörg |
The Following 4 Users Say Thank You to Jörg Vogel For This Useful Post: | ||
Steven Hamoen (12-16-2015) |
#3
|
||||
|
||||
Hi Jörg,
Thanks for replying and taking the effort to create your example model! Concerning the time, I was more interested having something similar as in normal Flexsim with a time and date. Ofcourse I could copy the code from the standard Flexsim Text object but I hoped this options was available in ProcessFlow. Apparently not so I think this is something that should be added in the future. While investigating I found another easy way to show the standard date and time. Simply type: return getmodelunit(CURRENT_TIME_STR); But this works with the date when first saved the model I think. Of course that can be update also etc. Concerning the pallets, I'm not counting pallets I'm counting truck loads. So if a truck arrives a x number of a pallets arrive. yes I can create tokens (I don't have a matching 3D model yet, so only processflow) for these pallets but then I get a lot of tokens in my system including long lists and lot of events, which makes it more difficult to step through a model and might influence performance. That is why I was looking to use like a global number. Concerning the trigger question, yes some old fashioned code can do the trick but I think I learned somewhere in the past that the lists could fire triggers when things happened (somethink like a dynamics field ) and because of my approach that sounded like a good solution. So I was looking for somebody to tell me how or to tell me that that is not possible. The funny part is that I'm writing this now and the solution is ofcourse to use an expression field. That is used to update a field but there is nothing there to prevent you to write some other code that triggers something if certain values are reached. You can even use that field to store if you have triggered the creation of new pallets! You might even use that trigger to control a seperate list to have this 1 number there but that sounds like overkill. The only question that still keeps there is the timetable equivalent so there is probably no other solution here then to start writing some code. Thanks, Steven |
The Following User Says Thank You to Steven Hamoen For This Useful Post: | ||
Jörg Vogel (12-16-2015) |
#4
|
||||
|
||||
Steven,
On the time tables, it's pretty simple. Just use an event-triggered source or a wait for event, and link the activity to one of the time table's events (click on the ! beside the activity, then sample the event either from the toolbox or in the time table's properties window). On the list question, here are some possibilities: 1. You could just not worry that there are multiple entries on the list. When you want to add to the list you just push the value that you want to add. When you then pull with the SELECT clause, it will "use up" the entries that it needs. The difficulty with this option is that it's difficult to listen for when the sum value gets below a certain level. You could have a separate process that 1. uses an event-triggered source to wait for the list's OnPush, 2. enters a zone based on the quantity pushed, 3. Uses a wait for event to listen for that specific value to be pulled from the list, and 4. exits the zone. Then you track when the Zone's content gets below a certain level. Or, if each entry represented exactly one pallet, then you could use a wait for event to wait for the list content to get below a certain value. Either way, I don't think that was exactly what you were looking for. I wanted a list feature to allow the user to define certain fields as tracked statistics, so that it will track the sum of that field's values, (in which case you could listen for the statistic to get above/below some value) but I didn't get that in for the 1.0 release. 2. You can use a dynamic label field on the list. When a pull request using the SELECT clause selects a dynamic label field, the field will actually decrement the value of the label by the requested amount. So pulls would decrement the value, and when you want to push, instead of actually pushing you'd just increment the label. The drawbacks to this would be, first, the pushing logic would be a little more complex because if the label value gets to zero, the entry will be removed from the list, so when you push, you'd have to say, if zero, push, else increment. Second, again, it's difficult to listen for the value to get below something. 3. You could bypass the list altogether and use a global tracked variable. "Pushes" would increment the tracked variable, and "Pulls" would decrement the tracked variable. The advantage of this is that now listening to the tracked variable's value becomes much easier, just use a wait for event or event-triggered source and sample the variable's OnChange from the toolbox. The optimal solution in my opinion would be option 1 if we just had the list optionally tracking field sums, and then you could simply listen for that statistics OnChange, to get below some value. But given that that's not a feature yet, I would advise either option 1 with the extra zone-based tracking, or option 3. Using the expression field of the list to actually trigger things happening sounds a little hokey to me, but I guess if it works it works. |
The Following User Says Thank You to Anthony Johnson For This Useful Post: | ||
Steven Hamoen (12-16-2015) |
#5
|
||||
|
||||
Jorg,
Instead of the tree-based access to the list partition, I would suggest using: Code:
content(listentries(globallist("StoredPallets"), partitionID)) |
The Following User Says Thank You to Anthony Johnson For This Useful Post: | ||
Jörg Vogel (12-17-2015) |
#6
|
||||
|
||||
Steven,
As I look at the current UI, it might not be completely apparent how to do option 1 with the zone tracking mentioned in my previous post. So, here's how you do it. 1. Use a global list. (Add a global list, then a process flow list that is linked to the global list). 2. Add an event triggered source, then use the ! button to sample the list in the process flow and select OnPush. In the Label Assignment table, assign the pushed Value to the token's "count" label. 3. Add a zone, in the zone, add a subset named AllTokens, and add a Subset Calculation named Total Value, with a Label/expression to sum as "count" (this sums up the count label of the tokens in the zone). 4. After the event-triggered source, add an enter zone to enter the zone you just created. 5. After the enter zone, add a wait for event, for its Object field, enter the expression: last(listentries(globallist("Pallets"), 0)), and for its Event field, enter OnPull. This will listen for the just-pushed entry to be pulled off the list (sorry, UI won't auto-guide you here, you have to enter it manually). 6. Add an exit zone after the wait for event that exits the zone. Once you've done that, you should be able to track the zone's Total Value: 1. Add an event-triggered source or wait for event somewhere. 2. Click the ! button and sample the zone and choose On Calculation Total Change. 3. In the activity's quick properties, under Subset, enter "AllTokens" (including quotes), and under Calculation, enter "Total Value" (including quotes). 4. In the Change Rule, select Decrease To Or Through Value, and enter the value you want to listen for. Hope this helps. If it's a bit overkill, then maybe my option 3 would be better. Eventually we'll have the list field sum tracking feature so all this can go away. You might also need to adjust this process if you are pulling partial entries from the list with the SELECT clause, because you might need to listen multiple times to the OnPull until the entry is actually removed. But this gives you the basic idea. Last edited by Anthony Johnson; 12-16-2015 at 03:04 PM. |
The Following User Says Thank You to Anthony Johnson For This Useful Post: | ||
Steven Hamoen (12-16-2015) |
Thread | Thread Starter | Forum | Replies | Last Post |
ProcessFlow Release | Steven Hamoen | Q&A | 2 | 12-11-2015 01:24 PM |
Questions regarding GUI | mearjun | Q&A | 2 | 07-08-2013 12:18 PM |
Statistics questions | Jack Lai | Container Terminal (CT) Library | 2 | 07-16-2012 03:59 AM |
Questions of TrafficControl ? | Li Chin | Q&A | 0 | 01-15-2009 07:32 AM |