0

I have a 2 column table data on excel for energy consumption (representing consumption per month). I want to input that data to a stock representing the consumption of the SME in my system dynamics model on AnyLogic. I used the table function to do so, but I am receiving an error saying:''Type mismatch: cannot convert from TableFunction to double''.

So anyone had some ideas on how can I input this data as a stock and generate results on graphs similarly?

  • 1
    Welcome to SOF! Please provide more context with screenshots and code snippets. Have you defined variables for this purpose? If so, please show them also. – Yashar Ahmadov Nov 15 '21 at 14:41

1 Answers1

0

Judging by the error message, you are using the full TableFunction as parameter. Instead you should use yourTableFunctionName.get(double x) in your model to refer to specific stock value.

Yashar Ahmadov
  • 1,616
  • 2
  • 10
  • 21
  • Thank you for your support I followed your recommendation but another error came up saying: '' Double X cannot be resolved to a variable''. I hope you have any suggestions and thank you again. – Hussien Alkadri Nov 16 '21 at 13:55
  • Instead of double x you should type the index that you are looking in your table...if you are looking for the stock value of product 1, then type `yourTableFunctionName.get(1)`... – Yashar Ahmadov Nov 16 '21 at 13:57