Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In addition did the second extension, which was to make a simulation that mixes the agents. I made a new simulation class, called MasterGrouperSimulation, and made one of the user inputs be a number indicating which kind of grouper they want to use. I checked which integer they provided, and decided which kind of agent to add to the landscape based on this. I also made changes to how the pictures would be saved based on this in the main method. The main issue with this extension was deciding how many of each kind of grouper to make. To do this, I used code like that below, where I get the remainder of the number of requested agents, and if there is none, I divide the groupers evenly between the number of agents divided by three. A third of them will be in each respective group. For cases where the number is not divisible by three, I get the number of agents requested, and subtract the remainder that prevents it from being divisible. Then, the leftover ones are created as regular groupers.

MixedGrouper:

In case it wasn't obvious, I also did the first extension, which is to let the user control which groupers they use without having to use different kinds of simulation files. If they provide 0, it is a regular group, if they choose 1, it is a categorized grouper, if the number is 2, it is a shy grouper, and if it is 4, it is a mixed grouper, from the other extension.

...