PK MLp codemeta.json{"@context": ["https://doi.org/doi:10.5063/schema/codemeta-2.0", "http://schema.org"], "@type": "SoftwareSourceCode", "provider": {"url": "https://www.comses.net", "@type": "Organization", "name": "CoMSES Network (CoMSES)", "@id": "https://www.comses.net"}}PK MLg1' docs/index-all.html
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
Each annotation type has its own separate page with the following sections:
Each enum has its own separate page with the following sections:
There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object
. The interfaces do not inherit from java.lang.Object
.
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
These links take you to the next or previous class, interface, package, or related page.
These links show and hide the HTML frames. All pages are available with or without frames.
The All Classes link shows all classes and interfaces except non-static nested types.
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
The Constant Field Values page lists the static final fields and their values.
public abstract class EthnoModel
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected double |
b |
protected double |
basePTR |
protected double |
c |
protected double |
deathRate |
protected java.util.ArrayList<Cell> |
empty |
protected int |
freeCells |
protected double |
immigrationRate |
protected int |
iterations |
protected Lattice |
lattice |
protected int |
latticeSize |
protected int |
markers |
protected double |
mu |
protected java.util.ArrayList<Cell> |
occupied |
protected boolean |
randomMarker |
Constructor and Description |
---|
EthnoModel(int latticeSize,
double b,
double c,
double basePTR,
double mu,
double deathRate,
double immigrationRate,
int markers,
int iterations)
Constructs a model on a spatial structure chosen by subclass.
|
Modifier and Type | Method and Description |
---|---|
int[][] |
getDistributions()
Compute distribution of strategies and markers in the population.
|
abstract void |
run()
Run the model.
|
void |
set(int latticeSize,
double b,
double c,
double basePTR,
double mu,
double deathRate,
double immigrationRate,
int markers,
int iterations)
Changes values of instance variables.
|
protected double b
protected double c
protected double basePTR
protected double mu
protected double deathRate
protected double immigrationRate
protected int latticeSize
protected int iterations
protected int markers
protected Lattice lattice
protected java.util.ArrayList<Cell> empty
protected java.util.ArrayList<Cell> occupied
protected int freeCells
protected boolean randomMarker
public EthnoModel(int latticeSize, double b, double c, double basePTR, double mu, double deathRate, double immigrationRate, int markers, int iterations)
latticeSize
- number of patchesb
- benefit from partner co-operatingc
- cost from co-operatingbasePTR
- potential to reproducemu
- mutation ratedeathRate
- probability of removing an agentimmigrationRate
- number of individuals entering the population each roundmarkers
- number of potential markersiterations
- number of rounds before terminationpublic void set(int latticeSize, double b, double c, double basePTR, double mu, double deathRate, double immigrationRate, int markers, int iterations)
public abstract void run()
public int[][] getDistributions()
Constructor and Description |
---|
Lattice2D(int size,
int k)
Constructs a lattice.
|
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<Cell> |
getLattice() |
Cell |
getRandomCell() |
Cell |
getRandomEmptyCell() |
public Lattice2D(int size, int k)
size
- size of lattice in one dimensionk
- number of neighbourspublic Cell getRandomCell()
public Cell getRandomEmptyCell()
public java.util.ArrayList<Cell> getLattice()
getLattice
in interface Lattice
public class HAModel extends EthnoModel
b, basePTR, c, deathRate, empty, freeCells, immigrationRate, iterations, lattice, latticeSize, markers, mu, occupied, randomMarker
Constructor and Description |
---|
HAModel(int latticeSize,
double b,
double c,
double basePTR,
double mu,
double deathRate,
double immigrationRate,
int markers,
int iterations)
Constructs a model with a lattice.
|
HAModel(int latticeSize,
double b,
double c,
double basePTR,
double mu,
double deathRate,
double immigrationRate,
int markers,
int iterations,
double mmu)
Constructs a model with a lattice, and markers and strategies mutating at different rates.
|
HAModel(int latticeSize,
int k,
double p,
double b,
double c,
double basePTR,
double mu,
double deathRate,
double immigrationRate,
int markers,
int iterations)
Constructs a model with a network structure.
|
HAModel(int latticeSize,
int k,
double p,
double b,
double c,
double basePTR,
double mu,
double deathRate,
double immigrationRate,
int markers,
int iterations,
double mmu)
Constructs a model with a network structure, and markers and strategies mutating at different rates.
|
HAModel(int latticeSize,
int k,
double b,
double c,
double basePTR,
double mu,
double deathRate,
double immigrationRate,
int markers,
int iterations)
Constructs a model with a lattice and an optional number of immigrants < 25.
|
HAModel(int latticeSize,
int k,
double b,
double c,
double basePTR,
double mu,
double deathRate,
double immigrationRate,
int markers,
int iterations,
double mmu)
Constructs a model with a lattice and an optional number of immigrants < 25, and markers and strategies mutating at different rates.
|
Modifier and Type | Method and Description |
---|---|
void |
run()
Run the model.
|
getDistributions, set
public HAModel(int latticeSize, double b, double c, double basePTR, double mu, double deathRate, double immigrationRate, int markers, int iterations)
public HAModel(int latticeSize, int k, double b, double c, double basePTR, double mu, double deathRate, double immigrationRate, int markers, int iterations)
k
- number of neighbourspublic HAModel(int latticeSize, int k, double p, double b, double c, double basePTR, double mu, double deathRate, double immigrationRate, int markers, int iterations)
p
- probability of rewiring an edge connecting an agent to a neighbour to a randomly chosen agent in the networkpublic HAModel(int latticeSize, double b, double c, double basePTR, double mu, double deathRate, double immigrationRate, int markers, int iterations, double mmu)
mmu
- marker mutation rate, given as a negative if used for marker misperception rate insteadpublic HAModel(int latticeSize, int k, double b, double c, double basePTR, double mu, double deathRate, double immigrationRate, int markers, int iterations, double mmu)
public HAModel(int latticeSize, int k, double p, double b, double c, double basePTR, double mu, double deathRate, double immigrationRate, int markers, int iterations, double mmu)
public void run()
EthnoModel
run
in class EthnoModel
Constructor and Description |
---|
Network(int size)
Constructs a network (graph) of cells without initial connections.
|
Network(int size,
int k,
double p)
Constructs a network (graph) of cells connected on a ring with rewiring.
|
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<Cell> |
getLattice() |
void |
restructure(double p)
Rewires the network.
|
void |
setupNeighbourhood(int k)
Adds neighbours to each cell in two directions.
|
public Network(int size)
size
- number of cells in the networkpublic Network(int size, int k, double p)
k
- number of neighbours in one direction (with total number of neighbours being 2*k)p
- probability of rewiring a single connection between neighbouring cells to another randomly chosen cellpublic void setupNeighbourhood(int k)
k
- number of neighbours in one direction (with total number of neighbours being 2*k)public void restructure(double p)
p
- probability of rewiring a single connection between neighbouring cells to another randomly chosen cellpublic java.util.ArrayList<Cell> getLattice()
getLattice
in interface Lattice
public class KinModel extends EthnoModel
b, basePTR, c, deathRate, empty, freeCells, immigrationRate, iterations, lattice, latticeSize, markers, mu, occupied, randomMarker
Constructor and Description |
---|
KinModel(int latticeSize,
double b,
double c,
double basePTR,
double mu,
double deathRate,
double immigrationRate,
int markers,
int iterations)
Constructs a model with a lattice.
|
KinModel(int latticeSize,
int k,
double p,
double b,
double c,
double basePTR,
double mu,
double deathRate,
double immigrationRate,
int markers,
int iterations)
Constructs a model with a network structure.
|
KinModel(int latticeSize,
int k,
double b,
double c,
double basePTR,
double mu,
double deathRate,
double immigrationRate,
int markers,
int iterations)
Constructs a model with a lattice and an optional number of immigrants < 25.
|
Modifier and Type | Method and Description |
---|---|
int[][] |
getRatios() |
void |
run()
Run the model.
|
boolean[] |
strategyConverter(int n)
Converts a number to an array of strategies (co-operate with {ingroup,outgroup,kin}?).
|
getDistributions, set
public KinModel(int latticeSize, double b, double c, double basePTR, double mu, double deathRate, double immigrationRate, int markers, int iterations)
public KinModel(int latticeSize, int k, double b, double c, double basePTR, double mu, double deathRate, double immigrationRate, int markers, int iterations)
k
- number of neighbourspublic KinModel(int latticeSize, int k, double p, double b, double c, double basePTR, double mu, double deathRate, double immigrationRate, int markers, int iterations)
p
- probability of rewiring an edge connecting an agent to a neighbour to a randomly chosen agent in the networkpublic void run()
EthnoModel
run
in class EthnoModel
public boolean[] strategyConverter(int n)
n
- number to convertpublic int[][] getRatios()
public class Cell
extends java.lang.Object
Constructor and Description |
---|
Cell()
Constructs an empty cell with no neighbours.
|
Cell(Agent agent)
Constructs an inhabited cell with no neighbours.
|
Cell(Agent agent,
java.util.ArrayList<Cell> neighbours)
Constructs an inhabited cell with neighbours.
|
Modifier and Type | Method and Description |
---|---|
void |
addNeighbour(Cell neighbour) |
Agent |
getAgent() |
java.util.ArrayList<Cell> |
getNeighbours() |
boolean |
hasAgent() |
void |
removeNeighbour(Cell neighbour) |
void |
setAgent(Agent agent) |
public Cell()
public Cell(Agent agent)
agent
- the agent to inhabit the cellpublic boolean hasAgent()
public Agent getAgent()
public java.util.ArrayList<Cell> getNeighbours()
public void setAgent(Agent agent)
public void addNeighbour(Cell neighbour)
public void removeNeighbour(Cell neighbour)
Interface | Description |
---|---|
Lattice |
A general spatial structure framework.
|
Class | Description |
---|---|
Agent |
An agent with group marker, strategies, kin marker and that can reproduce.
|
Cell |
A cell in a spatial structure that can host one agent.
|
Ethno |
Takes commands from a text prompt to instantiate and run classes.
|
EthnoModel |
A general model framework.
|
HAModel |
The original HammondAxelrod model.
|
HAModelStructureless |
The original HammondAxelrod model with a well-mixed population (without spatial structure).
|
HAModelStructurelessAssortment |
The original HammondAxelrod model with a well-mixed population (without spatial structure) and weights for having a different probability of interacting with an ingroup member.
|
KinModel |
The HammondAxelrod model with agents who can recognise kin.
|
KinModelStructureless |
A model where agents can recognise kin in a well-mixed population.
|
Lattice2D |
A two-dimensional lattice of cells, with wrap-around borders (a torus).
|
Lattice2DLR |
A standard lattice wrap-around borders and one neighbour to the left, right, above and below.
|
LatticeStructureless |
Containing a list of cells used with a well-mixed population.
|
Network |
A network with neighbouring cells on a ring that may be rewired to neighbour any cell in the network, resulting in a small-world network.
|
Output |
Outputs results from simulations.
|
public class Ethno
extends java.lang.Object
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public static void toScreen(int[][] distributions)
public interface Lattice
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<Cell> |
getLattice() |
java.util.ArrayList<Cell> getLattice()
public class Agent
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean[] |
strategies |
Constructor and Description |
---|
Agent(double ptr,
int marker,
boolean[] strategies)
Constructs an agent without an ancestor.
|
Agent(double ptr,
int marker,
boolean[] strategies,
Agent parent)
Constructs an agent without an ancestor.
|
Modifier and Type | Method and Description |
---|---|
void |
changePTR(double rate) |
int |
getMarker() |
Agent |
getParent() |
double |
getPTR() |
boolean[] |
getStrategies() |
void |
setMarker(int marker) |
void |
setPTR(double ptr) |
void |
setStrategy(int i,
boolean strategy) |
public Agent(double ptr, int marker, boolean[] strategies)
ptr
- initial potential to reproducemarker
- group markerstrategies
- set of strategies towards different agentspublic Agent(double ptr, int marker, boolean[] strategies, Agent parent)
parent
- an ancestor which defines the kin markerpublic double getPTR()
public int getMarker()
public boolean[] getStrategies()
public Agent getParent()
public void setPTR(double ptr)
public void changePTR(double rate)
rate
- increase (negative value for a decrease) of PTRpublic void setStrategy(int i, boolean strategy)
public void setMarker(int marker)