-1

As part of my dissertation work, I will be working on a circuit of capital model of the capitalist system. I apologize for the long explanation/multiple questions, but my professors can help me only with the theory here, rather than the coding. Basically, the aim is to create an agent-based model in which the following happens each turn:

  1. agents are split up into capitalists and workers
  2. capitalists have some sum of money, they buy machines (at the lowest cost they can find) and hire workers
  3. they produce output and make sales
  4. buyers attempt to buy at the lowest price
  5. capitalists compete, attempting to increase output (through becoming more technological, that is, increasing the ratio of machine to workers.)

Right now, I will be working on a simplified version of this. As I am a new coder, I am having some issues getting this up and running. I'm fine at reverse engineering other codes, but no existing codes deal with this in the way I'm looking for. The specific questions I have right now are:

  1. what's the best way to get capitalists to hire workers? As of right now, workers set their "employee-id" to the id of the capitalist, looping the procedure n times, where n is their demand for workers. Is there a more resource-efficient way to do this.
  2. what's the most resource efficient way to get buyers (capitalists or workers) to find the lowest price? Is there anything more efficient than "min-one-of" in this case? In future version of the model, I would like buyers to find the capitalist with the lowest price AND [inventory > 0], moving onto to the next-lowest price firm if the lowest-price one sells out. Ideally I'd want to keep the door open to that in the code.
  3. As of right now, patches represent individual industries or sectors of the economy (say the machine goods industry vs. the food industry). In future version of the model, I would want an individual capitalist to be able to have one plant with workers in machines goods but also expand into the food industry on a different patch, hiring different workers. What would be a good, resource efficient way to go about this?

Thanks so much for all your help, Daniel

  • on Stack Overflow you need to ask one question at a time, that's the format here, as a little browsing around https://stackoverflow.com/questions/tagged/netlogo will show – Seth Tisue Apr 22 '18 at 10:16

1 Answers1

3

Here's a part answer, which is more partial comments than an answer but too long as comments. Stack Overflow is to help you fix code errors, we can potentially help if you have a piece of code partially implemented and can't figure out how to make it work. But most of your questions are questions about the algorithm to use rather than how to write the algorithm in NetLogo, and algorithm choice is subjective and requires significant understanding of the subject matter. Some are a little more straighforward.

1/ by ID I am assuming you mean the who number. General rule of thumb, don't use who numbers. A variable can store the turtle, such as let myfriend one-of turtles. If you use who numbers, you constantly need to convert between the who and the turtle instead of just referring to the turtle directly.

the easiest way to have 10 employees for a capitalist is to ask the capitalist to randomly select 10 workers (look up n-of). There is no need to loop. Then you can do as you suggest - having a variable of the worker to identify the employer and a variable of the employer identify the agentset of workers. The other common approach is to construct a link.

2/ min-one-of is the correct primitive to identify the turtle with the minimum value of the specified variable. Note that you don't have to apply min-one-of to the whole set of turtles, there is no problem with asking for min-one-of turtles with [inventory > 0][price] and it will only search through the turtles that meet the condition to look for the one with the lowest price.

3/ Really too problem dependent to be answerable

JenB
  • 17,620
  • 2
  • 17
  • 45