Jump to content
Simio Forum

Welcome to the Simio Forum

Welcome to the Simio Forum! Experience the full experience of the forum by becoming a Simio Insider! You must be an Insider to post on any forum!

Click_Here_button.png

SimioSupport

What is a Function and why would I use it?

Recommended Posts

First of all there are "functions" and "Functions" that should not be confused.


The generic "function" (lower case) refers to built-in calculations that are available as part of Simio. For example fixed objects (like server) have a function named "NumberInSystem".


"Functions" (with an uppercase) are a feature avaiable to users:Functions.PNG.2f0415d8ca5c38fe9071350eab1aa45e.PNG Essentially a "Function" is a user-defined "function".


While using a Function itself does not provide much that is not already available by typing the expression directly, the main benefit is to be able to abstract details from the model to make the model easier to understand, use, and maintain.


Functions are most useful for sharing an expression across several objects. For example if you have a complex expression for calculating a processing time, and you use that expression in several different places, you can instead make that expression a function. This can make your model easier to maintain, since you can now update the expression in just one place and the new value will be returned everywhere that uses the function.


You can also use Functions simply to make your model easier to read. Rather than having the complex expression directly referenced in your model, you can define the expression as a Function, and give that function a meaningful name.


By combining the two above features, you can simplify routine use of your model. Say, for example, you had two different common ways of calculating processing time. To avoid typing and retyping the appropriate expression each time you change, you could define functions named “PTime_MethodA” and “PTime_MethodB” with the appropriate expressions and just change between those names as desired.

Share this post


Link to post
Share on other sites

From my experience with the tool, "Functions" do not generally save much time. As alluded to in the answer("...you could define functions named “PTime_MethodA” and “PTime_MethodB” with the appropriate expressions..."), you must make a new function each time you use a new variable... even if you want to use them in the exact same way (which is what a Function is used for in object oriented languages).


It would be a lot cleaner if we could use variables as parameters in these "Functions" without hard-coding them in, instead what we have is almost the exact opposite of what a Function should be used for.

Share this post


Link to post
Share on other sites

×
×
  • Create New...