Hello, I would like to know if it is possible to set the inter-arrival time using FlexScript. If yes, could you provide some guidance? Thanks a lot!
Hello, I would like to know if it is possible to set the inter-arrival time using FlexScript. If yes, could you provide some guidance? Thanks a lot!
Are you looking to change the inter arrival time in a 3D source or a Process Flow activity?
You can read a node value. This can be tree node, label, table cell and so on. This value can you change. When ever an item is leaving your source, then next inter arrival will be read and an event is created in the event list. You can alter such written events by commands.
The inter arrival time can be set through the "setProperty()" method.
For example:
Object source = Model.find("Source1");
source.setProperty("InterArrivalTime", 2.71);
You can check the documentation for object properties that can be changed this way. Or, what I often do, check out which properties exist by looking at the columns available in an object property table.
Thank you so much for providing the method to set the InterArrivalTime property using setProperty. It works perfectly when setting it to a fixed number like 2.71.
However, I would like to set it to a dynamic function, such as exponential(0, 10, getstream(current)), to allow for variability in the inter-arrival times. Could you please guide me on how to achieve this? Is there a specific way to pass such expressions into setProperty, or is there an alternative approach I should use?
Thank you again for your assistance!
You can put the distribution into the function as a string. But since this will overwrite the code header, you need to derive "current" how it would normally be done in the header
object.setProperty("InterArrivalTime", "exponential(0, 10, getstream(ownerobject(c)))");
Instead of setting the time as a property you could of course also just write code that takes parameters from somewhere else in the model (for example labels on the source) and then you change those.
14 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