A Bernoulli distribution is also created that will be driven by the resistance probability. Boolean samples from this distribution will determine whether or not cooperation occurs.
This method is can be used by DirectedAgent2d agents to convert a direction in integer degrees into relative coordinate offsets. By itself, it does not necessarily preserve the information of the direction integer. The values are [-1,0,+1] offsets.
This moves an an agent in the rough direction indicated by setOffsets.
A directed agent is a circle of some radius with a line from the center indicating the direction.
This samples from an agent's resistance distribution. It is a method because some agents don't yet have the notion of variable resistance, although such an extension is plausible enough that moving the resistance probability parameters into another class seems excessive.
This samples an energy budget from an agent's energy distribution. It is a method because some the point at which agents get more energy varies by agent type.
When frobbed, the DirectedAgent2d samples from a Bernoulli distribution that returns true according to the most recent resistProbability. If it is not true, or the agent is out of energy, then the agent submits to the direction of the frobber. Otherwise, the agent expends a unit of energy to resist the frobber. The flag `frobbed' is always set and the flag `resisting' to indicate resistance occurred.
The frob status flags `resisting' and `frobbed' are set to false.