Island Model (ver. 1.0)
=======================

Based on Fagiolo, G., Dosi, G. (2003) Exploitation, exploration and innovation in a model of endogenous growth with locally interacting agents, Structural Change and Economic Dynamics,
v. 14, p. 237-273.

Recoded in LSD by Marcelo C. Pereira

Model setup
-----------
The number of instances of all the model's objects should be set to 1. The model equations create and delete all the required object instances.

Not all model parameters are supposed to be set by the user, please refer to the information on each one to see if changing values is posible and the appropriate ranges (user parameters).

Model structure
---------------

The code is organized in sections, associated to the respective object types:

 - Sea: single object instance representing one sea
 - Island: one instance per island (known/unknown)
 - KnowIsland: one instance per known island
 - Miner: one dummy instance per agent mining on island
 - Agent: one instance per agent
 
Object Sea
----------
Init: initializes the model, run once
 . Create the lattice, if appropriate
 . Create the  random initial islands (known/unknown)
 . Draw the initially known islands
 . Allocate agents in known islands randomly
Step: forces agents to decide what to do first
l: counts the known islands
m: counts the number of miners
Q: accumulates the seas production (GDP)
J: expands and counts the islands set
 . Expand each frontier as required (N, S, W, E)

Object KnownIsland
------------------
_m: counts the miners in the island
 . Ignore inactive Miner object instances
 . Adjust island color on the lattice (empty/colonized) 
_Qisland: accumulates the island production
_c: compute the island productivity

Object Miner
------------
_Qminer: compute miner production
_cBest: the best signal productivity received
 . Evaluates all signals received on the island

Object Agent
------------
_a: define the state of the agent
 . If an Explorer, navigate to a new random position
 . If an Imitator, navigate the shortest path to target
 . If navigator, update position on the lattice
 . If arrive in an island, become a Miner
 . If a Miner decide if become Explorer or Imitator

Data structure
--------------
Object Root: 
 . User parameters: simSpeed, sizeLattice
 . Internal parameter: latticeOpen (do not change)
Object Sea: 
 . User parameters: N, alpha, epsilon, phi, lambda, pi, rho, l0radius, minSgnPrb
 . Variables: l, m, J, Q
 . Internal parameters: seaShown, xxxxFrontier (do not change)
 . Internal variables: Init, Step
Object Island: 
 . Internal parameters: _known, _idIsland, _xIsland, _yIsland (do not change)
Object KnowIsland:
 . Variables: _c, _m, _Qisland
 . Internal parameters: _idKnown, _s (do not change)
Object Miner:
 . Variables: _cBest, _Qminer
 . Internal parameters: _active, _agentId, _xBest, _yBest (do not change)
Object Agent: 
 . Variables: _a
 . Internal parameters: _idAgent, _knownId, _xAgent, _yAgent, _xTarget, _yTarget, _Qlast (do not change)
 
Original paper parameters
-------------------------
All the original paper parameters and initial conditions can be found in object Sea and can be changed.

The lattice
-----------
Can be turned off for speed: sizeLattice = 0
Can show the entire sea or just the central area: sizeLattice
 . Sea size = 2 * total time steps + 1
Reduce simulation speed: simSpeed

Topology configuration
----------------------
Set the maximum radius for initial known islands: l0radius
Define the minimum signal probability to consider (speed-up): minSgnPrb

hook pointers
-------------
LSD hook pointers connect all the objects to maximize performance:
 . KnowIsland -> Island
 . Miner -> Agent
 . Agent -> Miner

Diffusion network
-----------------
Each KnownIsland instance is the hub of a star network to all other relevant known islands
 . Link creation depends on the signal intensity threshold defined by MinSgnPrb
 . All links are bidirectional
 . Link weight is defined by the exponential decay factor between the two islands

