Finalise Application Code
Now that we have modelled our operational income and filled in all the relevant values into our Research Grid we can model our fixed costs and set up the code to find the final bank balance at the end of every time step which for this model is at the end of every month.
To model the Fixed costs and find the final bank balance we will need to exit the Research Grid and go back to the Build screen and our code editor.
Once in the build screen put the following lines of code at the top of the model:
These lines of code will allow the model import the necessary libraries to complete the calculations needed in our next few lines of code and allow us to model the noise demand that we have already defined as part of our operational income.
Once these lines are in replace the return {} at the bottom of the model with the following code:
The above lines of code not only Calculate the income and the costs, but also model the distribution noise, create timesteps in the model and work out and write the final bank balances to the Results tab. This is now a workable model of John and Jack’s coffee shop.
You have now completed a Python Application in Akumen. The next part of the tutorial is using the Research Grid to find the best price for a cup of coffee to maximize the return. Proceed to research to learn how to research the coffee shop findings, or click here to build the application in a Driver Model or here to build the application in R code.