Search code examples
arraysanylogic

Anylogic, dynamic variable array with different stocks as elements


I want to use a dynamic variable to concatenate the values of multiple stocks. I tried a couple of different methods I could think of to phrase the formula but this was the result each time.enter image description here The examples for arrays in Anylogic I found online all try to split up one element in multiple array entries by using a formula akin to dynamicVariable = stock * fractionArray[stockTypes] with an array of constant inputs, that splits up a single input stock. I couldn't find anything on how to actually assign different variables to different array elements.

The answer is probably really simple but I'm pretty stuck here, any help is greatly appreciated!


Solution

  • to do this, you need to separate your array elements as follows:
    dimensions

    Just click on stockTypes to select one of the options and then add formula to have the other option