Package org.evoludo.simulator.modules
Class CLabour
Object
Module
Continuous
CLabour
- All Implemented Interfaces:
Runnable
,IBS.HasIBS
,IBS.HasIBS.MCPairs
,MilestoneListener
,Features
,Features.Pairs
,HasDistribution
,HasDistribution.Strategy
,HasHistogram
,HasHistogram.Degree
,HasHistogram.Fitness
,HasHistogram.Strategy
,HasMean
,HasMean.Fitness
,HasMean.Strategy
,HasPop2D
,HasPop2D.Fitness
,HasPop2D.Strategy
,HasPop3D
,HasPop3D.Fitness
,HasPop3D.Strategy
,CLOProvider
public class CLabour
extends Continuous
implements IBS.HasIBS.MCPairs, HasPop2D.Strategy, HasPop3D.Strategy, HasMean.Strategy, HasHistogram.Strategy, HasDistribution.Strategy, HasPop2D.Fitness, HasPop3D.Fitness, HasMean.Fitness, HasHistogram.Fitness, HasHistogram.Degree
The module for the evolution of two behavioural traits. This module is
designed for the study of specialization and division of labour.
- Author:
- Christoph Hauert
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Continuous
Continuous.Benefits, Continuous.Costs, Continuous.Traits2Payoff
Nested classes/interfaces inherited from interface Features
Features.Groups, Features.Pairs, Features.Static
Nested classes/interfaces inherited from interface HasDistribution
HasDistribution.Strategy
Nested classes/interfaces inherited from interface HasHistogram
HasHistogram.Degree, HasHistogram.Fitness, HasHistogram.StatisticsProbability, HasHistogram.StatisticsStationary, HasHistogram.StatisticsTime, HasHistogram.Strategy
Nested classes/interfaces inherited from interface HasMean
HasMean.Fitness, HasMean.Strategy
Nested classes/interfaces inherited from interface HasPop2D
HasPop2D.Fitness, HasPop2D.Strategy
Nested classes/interfaces inherited from interface HasPop3D
HasPop3D.Fitness, HasPop3D.Strategy
Nested classes/interfaces inherited from interface IBS.HasIBS
IBS.HasIBS.CGroups, IBS.HasIBS.CPairs, IBS.HasIBS.DGroups, IBS.HasIBS.DPairs, IBS.HasIBS.MCGroups, IBS.HasIBS.MCPairs
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double[]
Temporary storage for the traits of the opponent.Fields inherited from class Continuous
cloBenefits, cloCosts, cloTraitRange, cxMaxMonoScore, cxMaxScore, cxMinMonoScore, cxMinScore, extremalScoresSet, MINMAX_ITER, MINMAX_STEPS, mutation, population, species, traitMax, traitMin, traits2payoff
Fields inherited from class Module
active, cloDeathRate, cloGeometry, cloNGroup, cloNPopulation, cloPhase2DAxis, cloSpeciesUpdateRate, cloTraitColors, cloTraitDisable, cloTraitNames, competition, deathRate, defaultColor, engine, ibs, ID, interaction, logger, map2fitness, markers, model, nActive, name, nGroup, nPopulation, nTraits, opponent, playerUpdate, speciesUpdateRate, structure, traitColor, traitName, trajectoryColor, VACANT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a string with information about the authors of the module.getKey()
Returns identifier of the active module.getTitle()
Returns title of active module, e.g.void
load()
Load new module and perform basic initializations.double
pairScores
(double[] me, double[] groupTraits, int len, double[] groupPayoffs) Calculate the payoff/score for modules with interactions in pairs and multiple continuous traits.void
unload()
Unload module and free all resources.Methods inherited from class Continuous
add, check, collectCLO, getMaxGameScore, getMaxMonoGameScore, getMinGameScore, getMinMonoGameScore, getMutation, getTraitMax, getTraitMin, setExtremalScores, setTraitRange
Methods inherited from class Module
createGeometry, createIBSPop, getActiveTraits, getCompetitionGeometry, getDeathRate, getDependent, getGeometry, getIBSPopulation, getID, getInteractionGeometry, getMapToFitness, getMarkers, getMeanColors, getModelTypes, getNActive, getName, getNGroup, getNPopulation, getNRoles, getNSpecies, getNTraits, getOpponent, getPlayerUpdate, getSpecies, getSpecies, getSpeciesUpdateRate, getTraitColor, getTraitColors, getTraitName, getTraitNames, getTrajectoryColor, getVacant, init, isNeutral, processColorMap, reset, run, setActiveTraits, setDeathRate, setGeometries, setIBSPopulation, setModel, setName, setNGroup, setNPopulation, setNTraits, setOpponent, setSpeciesUpdateRate, setTraitColors, setTraitNames, setTrajectoryColor
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface CLOProvider
adjustCLO
Methods inherited from interface Features.Pairs
isPairwise
Methods inherited from interface HasDistribution
getNTraits, getTraitName
Methods inherited from interface HasHistogram
getCustomLevels, getNTraits, getTraitColors
Methods inherited from interface IBS.HasIBS
createIBS
Methods inherited from interface MilestoneListener
modelDidInit, modelDidReset, modelLoaded, modelRelaxed, modelRunning, modelSettings, modelStopped, modelUnloaded, moduleLoaded, moduleRestored, moduleUnloaded
-
Field Details
-
you
protected double[] youTemporary storage for the traits of the opponent.
-
-
Constructor Details
-
CLabour
Constructs a new EvoLudo module for the evolution of two behavioural traits.- Parameters:
engine
- the manager of modules and pacemaker for running the model
-
-
Method Details
-
load
public void load()Description copied from class:Module
Load new module and perform basic initializations.- Overrides:
load
in classContinuous
- See Also:
-
unload
public void unload()Description copied from class:Module
Unload module and free all resources.- Overrides:
unload
in classContinuous
- See Also:
-
getKey
Description copied from class:Module
Returns identifier of the active module. For example, 2x2 games inTBT
return "2x2". This corresponds to the argument for the--module
option to load a particular module. The default is to use the class name. -
getAuthors
Description copied from class:Module
Returns a string with information about the authors of the module.- Overrides:
getAuthors
in classModule
- Returns:
- the names of the authors
-
getTitle
Description copied from class:Module
Returns title of active module, e.g. 2x2 games inTBT
returns "2x2 Games". -
pairScores
public double pairScores(double[] me, double[] groupTraits, int len, double[] groupPayoffs) Description copied from interface:IBS.HasIBS.MCPairs
Calculate the payoff/score for modules with interactions in pairs and multiple continuous traits. The focal individual has traitsme
and the traits of itslen
interaction partners are given ingroup
. The traits they are arranged in the usual manner, i.e. first all traits of the first group member then all traits by the second group member etc. for a total oflen*nTraits
entries. The payoffs/scores for each of thelen
opponent traits/strategies must be stored and returned in the arraypayoffs
.Note:
Only the firstlen
entries ingroup
are guaranteed to exist and have meaningful values. The population structure may restrict the size of the interaction group.len≤nGroup
always holds.Important:
must be overridden and implemented in subclasses that define game interactions between pairs of individuals (nGroup=2
,pairwise=true
), otherwise seeIBS.HasIBS.CGroups.groupScores(double, double[], int, double[])
.- Specified by:
pairScores
in interfaceIBS.HasIBS.MCPairs
- Parameters:
me
- the trait of the focal individualgroupTraits
- the traits of the group memberslen
- the number of memebrs in the groupgroupPayoffs
- the array for returning the payoffs/scores for each group member- Returns:
- the total (accumulated) payoff/score for the focal individual
-