Exercise 1 - The Hermit
A hermit is an autarkic consumer that does not interact with other agents. The hermit has a production function that turns man-hours into food. Your task is to program your own hermit with an optimal work-life balance, as the hermit enjoys both, food and man-hours spent as leisure time. The utility function of the hermit looks as follows (I recommend to install the plugin Tex all the thing to display tex equations in the browser):
Thus, the hermit enjoys eating potatoes and spending man-hours as leisure time equally. In order to maximize utility, he needs to decide how much of his 24 hours to spend on leisure time and how much on growing potatoes according to the following budget constraint:
The hours spent working are turned into potatoes via a Cobb-Douglas production function with fixed costs, with
The fixed costs of six hours represent the daily amount of work needed before actual production can start, for example for maintaining the required infrastructure. Plugging the production function and the budget constraint into the utility function, this leads to the following simplified maximization problem:
If you want, you can solve this problem mathematically. Alternatively, you can also just play around with your Hermit class to find out how to achieve a better utility. To do so, adjust the function 'produce', in which the hermit decides how much time to spend on growing food.
It is possible to edit this class directly here on github.com and then check the resulting ranking online. However, in practice, it is much more efficient to edit and test a local copy of your agents before uploading (pushing) them to github, a process which is described here. Note that the ranking is not based on total lifetime utility, but on an exponentially moving average as defined here, whereas the score s for day t is calculated as follows:
Document your findings in the lab journal as you try out different ideas to make your hermit behave optimally.
The deadline for submitting your hermit and the lab journal to github is 2017-10-03 at 24:00.