I am having trouble using two code snippets back to back in the process flow. The tokens move right past both blocks of custom code. The code snippets are referencing global variables, which aren't being updated in the dashboard.
I am having trouble using two code snippets back to back in the process flow. The tokens move right past both blocks of custom code. The code snippets are referencing global variables, which aren't being updated in the dashboard.
full.pngsnip1.pngsnip2.pnggv1.png
In this section of the process flow I am creating 4 tokens in "batch of 3" which makes 5 tokens that represent 3 objects. Next I am creating an object for the additional tokens that come through. I then change the size to look like three objects combined in "change visual" I then travel from one queue to another. Then the first code snippet will increment the contents of the queue. The second snippet will create a condition to reflect the availability of the first queue that was incremented earlier.
If you're referring to why your tokens 'jump' past the Custom Code activities when stepping, this is due to your Unload activity.
The task executer finishes its unload task, notifies the token it's complete and waits for the token to be released and execute whatever activities are next until it reaches an activity that causes the token to wait. The task executer is then able to continue on to its next task (or idle if no tasks remain).
In a nutshell, this seemingly odd jumping is important to keep the model logic executing in the same order whether you're running the model or the model is stopped and you're stepping. Certain activities like the task sequence activities 'lock' the model such that tokens move through multiple activities in one 'step'.
Your issue is due to the code you've written. The line
A1Contents = 0 && ProcessorA--;
is not two statements in one line, but instead is read by FlexSim to be a conditional or if statement. Instead you should write:
A1Contents = 0; ProcessorA--;
4 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved