Parameters:

N = Population size = {40, 90, 100}

The number of agents in the population.

b = Benefit of donation = 1

The amount of fitness benefit an agent receiving a donation obtains.

c = Cost of donation {0.05, 0.1, 0.5}

The amount of fitness cost applied to an agent making a donation.

P = Pairings {1, 3, 10}

The number of random pairings made for each agent in each generation.

m = Mutation rate {0.001, 0.01, 0.1}

The probability that agent traits will be mutated during reproduction to the next generation.

R = Radius of interaction {1, 10, 50}

The radius around the agent from which random pairings with other agents are drawn. Constraint: 0 < R ≤ n / 2. when r = N / 2 = 50, radius is entire population (as in the RCA model). When R = 1, radius is only immediate two neighbours (as in SK model).

TLB = Tolerance Lower Bound. TLB {-10-6, 0}

The tolerance lower bound determines the lowest value that any agent tolerance can be. This is determined by the CT parameter below.

CT = Cheater type. CT {ultraweak, weak, medium, strong}

The cheater type determines the kind of cheaters that should be implemented in the simulation. The following constraints hold:

If CT = ultraweak or weak then BT = 1 for all agents at all times.

If CT = ultraweak then TLB = 0, otherwise TLB = -10-6

Agent state variables:

i

T i = tolerance value of agent i. T ∈ [TLB, ∞].

The tolerance value is a real number stored by each agent used, in combination with tag values, to determine if to make a donation to another agent.

BT i = binary trait of agent i. BT ∈ {0,1}.

The binary trait, stored by each agent, determines if to make donations or not: 0 = turn off all donation, 1 = donate using tag / tolerance mechanism.

f i = fitness of agent i. f ∈ [0, ∞].

Agents accumulate a fitness value in each generation through interactions involving costs and benefits.

Main Outline Algorithm:

Initialise population of agents () // see function below

Loop for G generations

Loop for each agent A in population N

Loop for P pairings

Select a random agent B within agent A's radius

Agents Interact (A, B) // see function below

End loop

End loop

Reproduce Population () // see function below

End loop



Functions used in main outline algorithm:



// Initialise population of agents



Function Initialise population of agents ()

Create a ring of size N

Loop for each agent A in population N

Place agent A at next free position on ring

Set tag (t A ) and tolerance (T A ) to uniform random values from [0..1]

Set binary trait to 1 (BT A = 1)

Set fitness of agent to 0

End loop

End Function





// Agents A and B interact, A decides if to make a donation to B



Function Agents Interact (agent A, agent B)

If binary trait of A is turned on (BT A = 1) then

If tags of A and B are within tolerance of A ( |t A - t B | ≤ T A ) then

Fitness of B is increased by benefit (f B = f B + b)

Fitness of A is decreased by cost (f A = f A - c)

End if

End if

End function





// Reproduce a new population based on fitness of agent in current population



Function Reproduce Population ()

Create a new ring of size N for the new population

Loop for each agent A in population N

Select a random agent B within agent A's radius R

Reproduce agent (A or B) with higher fitness# (f) as agent C

Agent C is placed in the same location on the ring as agent A

With probability m mutate* tag (t C ) and tolerance (T C ) of agent C

If CT = medium then

with probability m mutate* binary trait (BT C )

else if CT = strong and binary trait is turned on (BT C = 1) then

with probability m mutate binary trait (BT C )

End if

End loop

New population becomes the current population

All agents in new population have fitness initialised to zero

End function



Notes: