Change Flowitem color on multiprocessor finish

Change Flowitem color on multiprocessor finish

j_patel2826
Contributor Contributor
199 Views
5 Replies
Message 1 of 6

Change Flowitem color on multiprocessor finish

j_patel2826
Contributor
Contributor

I have a unique situation. For model simplicity, I have a flowitem going to a mulitprocessor that has 20 processes to it. I would like the flowitem that is at that processor to change color after all 20 processes are complete. I would prefer to not add a queue to push the item to, so I have nowhere for the item to flow to after to use an exit/entry trigger. I was hoping the process complete trigger would work, but that triggers as soon as the first process is complete, not after the 20th. I tried pushing to a list but not sure where to set a trigger for entry on the list.  I thought about using the block status change of the multiprocessor but cannot seem to call on that status to perform the color change of the flowitem. 

In the attached model, I would like the box to change color once all 4 processes are done at that particular station. 

0 Likes
Accepted solutions (1)
200 Views
5 Replies
Replies (5)
Message 2 of 6

j_patel2826
Contributor
Contributor

For whoever looks at this, I am trying to find a process flow that can control this and in the attached model you can see the logic I have so far. It works fine if I select current or activity, and the color changes as soon as the flowitem is pushed to the list. But when I have the object be token.Frame, no colors change. 

0 Likes
Message 3 of 6

FelixMoehlmann
Collaborator
Collaborator
Accepted solution

The Process Finish trigger on the Multi Processor features the "opnum" parameter that lets you know which process finished. With an if-condition you can only change the color after a specific process.

0 Likes
Message 4 of 6

j_patel2826
Contributor
Contributor

Thank you for that solution. May I ask, do you have a computer science background of some kind to where you knew a lot of this custom coding? I took an intro to python course many many years ago but since I have not used it, I struggle remembering it. I understand some of the more basic things like the solution you just provided, but just curious how extensive your knowledge is in programming. What language does flexsim use? 

0 Likes
Message 5 of 6

FelixMoehlmann
Collaborator
Collaborator

FlexSim uses a custom language called FlexScript that is based on C++. I don't have much proper education in the field. One course in university over one semester where we essentially had to teach ourselves enough C++ to write an algorithm that uses Simulated Annealing to optimize a route (Travelling Salesman Problem) and the occasional video game about coding :D.

The rest is six years of experience of working with FlexSim professionally and learning along the way. In this case I also just looked at the code header of the On Process Finish trigger, saw the "opnum" variable and tested if that was indeed what it sounds like.

The page about basic coding in the manual and the following page on FlexSim specific commands will get you pretty far.

https://docs.flexsim.com/en/26.0/Reference/CodingInFlexSim/WritingLogic/WritingLogic.html

For a full list of class methods and properties you can also always look up the class documentation.

https://docs.flexsim.com/en/26.0/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Color.html

0 Likes
Message 6 of 6

j_patel2826
Contributor
Contributor

Very interesting. Yeah we worked the Travelling Salesman problem in school but never a coding approach to it. Thanks for the information and the sources for more learning. I will check those out. 

0 Likes