Verbose Pseudo-Algo
Start from an empty network with N nodes/agents (N is fixed throughout simulations)
Assign breeds i.e., "networkers" and "satisficers". Use the "prop-networkers" slider to determine the proportion of "networkers" in the population
Assign gender (binary variable) and seniority (integer; drawn from a Poisson distribution) to agents (currently: randomly; possible modifications: induce correlation between the two)
Decide T (#of iterations) and stopping condition (max #of links the network can have)
Do some graphics/plotting
End setup
t <- 0 (start tick counter)
for {t from 0 till T or stopping condition if reached before T}:
pick a random agent (i.e., a random network node)
consider all possibilities the agent has to change the current out-neighborhood i.e., consider what happens if the agent sends a link one by one to other agents that are not its current out-neighbors ("potential-advisors"), and consider what happens if the agent destroys a link one by one to other agents that are instead its current out-neighbors ("current-advisors")
to perform these calculations, new links must be formed and existing links must be destroyed; after this evaluation phase, the added links are removed again and the destroyed links are added again (the same outer neighborhood is maintained for the time being)
quantify "happiness" with resulting networks from each potential change with an objective function
the objective function is a linear combination of counts of network configurations (called "network effects") that are formed by each choice, weighted by betas (parameters in the GUI)
add a shock to the objective function
basically what happens in steps 9. to 14. is that the selected agent evaluates every possible 1-link modification of its own current out-neighborhood. To do this, these modified out-neighborhoods must first be formed and then evaluated. After evaluation, the marginal link is either destroyed or added again (re-store current neighborhood)
calculate objective function of current out-neighborhood (of doing nothing, current "happiness")
select the move maximizing objective function from possible 1-link modifications
choose the index of the move that maximizes the objective function from possible 1-link modifications to find out which is the target agent of the move
if utility/happiness from move that maximizes the objective function from possible 1-link modifications > utility/happiness from keeping current neighborhood
drop tie if the target agent is among current-advisors, add tie if is among potential-advisors
t <- t + 1