Combining Lookup Variables
Posted: Fri Nov 22, 2019 1:36 am
Hi,
I have two lookup variables I would like to combine into one. For example, given two lookup variables that represent an activity of a single individual in time as either engaged (1) or not (0): how can I combine "Work" and "Sleep" to have a third lookup variable "Busy". The input to the lookup variables is "Time".
Please find below some ideas I am exploring, but they are not straight forward. Ignore what is below if you have a straight forward suggestion.
I am able to combine (addition operator) the two lookup variables to have "Busy output" as an auxiliary variable that shows the expected output after simulation. However I am interested in a lookup variable so that I can find out what times are busy without running the entire simulation.
Another option I considered is to have two Vensim files. The first Vensim file creates the combined lookups for the duration of the simulation as an auxiliary variable "Busy output", then exports "Busy output" as an Excel file "Busy.xlsx". The second Vensim file then reads in "Busy.xlsx" as a lookup variable "Busy lookup" and proceeds. As you can imagine, this approach will be cumbersome, as well as error prone when scaling to multiple individuals. Also, this approach might require some mouse-clicking because I do not know how to export data automatically during, or after, a simulation without using mouse as illustrated in the help pages (http://www.vensim.com/documentation/data_export.htm).
Looking forward to your responses.
Regards
I have two lookup variables I would like to combine into one. For example, given two lookup variables that represent an activity of a single individual in time as either engaged (1) or not (0): how can I combine "Work" and "Sleep" to have a third lookup variable "Busy". The input to the lookup variables is "Time".
Please find below some ideas I am exploring, but they are not straight forward. Ignore what is below if you have a straight forward suggestion.
I am able to combine (addition operator) the two lookup variables to have "Busy output" as an auxiliary variable that shows the expected output after simulation. However I am interested in a lookup variable so that I can find out what times are busy without running the entire simulation.
Another option I considered is to have two Vensim files. The first Vensim file creates the combined lookups for the duration of the simulation as an auxiliary variable "Busy output", then exports "Busy output" as an Excel file "Busy.xlsx". The second Vensim file then reads in "Busy.xlsx" as a lookup variable "Busy lookup" and proceeds. As you can imagine, this approach will be cumbersome, as well as error prone when scaling to multiple individuals. Also, this approach might require some mouse-clicking because I do not know how to export data automatically during, or after, a simulation without using mouse as illustrated in the help pages (http://www.vensim.com/documentation/data_export.htm).
Looking forward to your responses.
Regards