Presumably a rookie question, but as suggested by the subject:
Where in Enterprise Dynamics can I possibly define global variables to be read from by all Atoms in my model?
More specific on what I want to accomplish, is for example a textbox on which I could simply type a value, to become readable by other Atoms. So for example I would have a Source Atom, in which I have the global variable set as inter-arrival time in seconds. And then a textbox on which I can simply type 10 to have my Source Atom's inter-arrival time be 10s.
How to define global variables?
- HarryBunnik
- Posts: 361
- Joined: Monday 07 February, 2011 - 11:22
Re: How to define global variables?
Hi Creator0822,
You can define global variables using Dimand local variables using Var.
So in code that would be something like:
And I would locate them on an initialize atom (Library => Tools => Initialize). That way you can be sure that it is always updated at the beginning of your simulation run. This is then the central point in your model where you can keep control over all your global variables (and labels and other things).
Another option is that you store such variables that must be updatable in table (with alias) and then read out the data on the initialize atom from the table:
Do(
Dim([valinterArrivalTime], vbValue, Cell(1, 1, refAliasOfyourTable),
....
)[/code]
Another option is that you read in the source directly from the table, but that has the downside that you need to update more when you are re-arranging the values stored in the table.
As you see, there are several ways to do things. I hope this helps you further!
Gr. Harry
You can define global variables using Dimand local variables using Var.
So in code that would be something like:
Code: Select all
Do(
Dim([valinterArrivalTime], vbValue, 10),
....
)
Another option is that you store such variables that must be updatable in table (with alias) and then read out the data on the initialize atom from the table:
Do(
Dim([valinterArrivalTime], vbValue, Cell(1, 1, refAliasOfyourTable),
....
)[/code]
Another option is that you read in the source directly from the table, but that has the downside that you need to update more when you are re-arranging the values stored in the table.
As you see, there are several ways to do things. I hope this helps you further!
Gr. Harry
-
- Posts: 5
- Joined: Thursday 19 November, 2020 - 21:31
Re: How to define global variables?
Thanks a lot, that was a really quick reply!!