Package org.evoludo.simulator.modules
Class CLabour
Object
Module
Continuous
CLabour
- All Implemented Interfaces:
Runnable,IBS.HasIBS,IBS.HasIBS.MCPairs,MilestoneListener,Features,Features.Pairs,Features.Payoffs,HasDistribution,HasDistribution.Strategy,HasHistogram,HasHistogram.Degree,HasHistogram.Fitness,HasHistogram.Strategy,HasMean,HasMean.Fitness,HasMean.Traits,HasPop2D,HasPop2D.Fitness,HasPop2D.Traits,HasPop3D,HasPop3D.Fitness,HasPop3D.Traits,CLOProvider
public class CLabour
extends Continuous
implements Features.Payoffs, IBS.HasIBS.MCPairs, HasPop2D.Traits, HasPop3D.Traits, HasMean.Traits, 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.Traits2PayoffNested classes/interfaces inherited from interface Features
Features.Groups, Features.Multispecies, Features.Pairs, Features.Payoffs, Features.StaticNested classes/interfaces inherited from interface HasDistribution
HasDistribution.StrategyNested classes/interfaces inherited from interface HasHistogram
HasHistogram.Degree, HasHistogram.Fitness, HasHistogram.StatisticsProbability, HasHistogram.StatisticsStationary, HasHistogram.StatisticsTime, HasHistogram.StrategyNested classes/interfaces inherited from interface HasMean
HasMean.Fitness, HasMean.TraitsNested classes/interfaces inherited from interface HasPop2D
HasPop2D.Fitness, HasPop2D.TraitsNested classes/interfaces inherited from interface HasPop3D
HasPop3D.Fitness, HasPop3D.TraitsNested 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, traits2payoffFields inherited from class Module
active, cloDeathRate, cloGeometry, cloNGroup, cloNPopulation, cloPhase2DAxes, cloTraitColors, cloTraitDisable, cloTraitNames, competition, deathRate, defaultColor, engine, ibs, ID, interaction, logger, map2fitness, markers, model, nActive, name, nGroup, nPopulation, nTraits, opponent, playerUpdate, 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.voidload()Load new module and perform basic initializations.doublepairScores(double[] me, double[] groupTraits, int len, double[] groupPayoffs) Calculate the payoff/score for modules with interactions in pairs and multiple continuous traits.voidunload()Unload module and free all resources.Methods inherited from class Continuous
add, check, collectCLO, getMaxMonoPayoff, getMaxPayoff, getMinMonoPayoff, getMinPayoff, getMutation, getTraitMax, getTraitMin, setExtremalScores, setTraitRangeMethods inherited from class Module
createGeometry, createIBSPop, createModel, getActiveTraits, getCompetitionGeometry, getDeathRate, getGeometry, getIBSPopulation, getID, getInteractionGeometry, getMap2Fitness, getMarkers, getMeanColors, getModelTypes, getNActive, getName, getNGroup, getNPopulation, getNRoles, getNSpecies, getNTraits, getOpponent, getPlayerUpdate, getSpecies, getSpecies, getTraitColor, getTraitColors, getTraitName, getTraitNames, getTrajectoryColor, getVacant, init, processColorMap, reset, run, setActiveTraits, setDeathRate, setGeometries, setIBSPopulation, setModel, setName, setNGroup, setNPopulation, setNTraits, setOpponent, setTraitColors, setTraitNames, setTrajectoryColorMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CLOProvider
adjustCLOMethods inherited from interface Features
isMultispecies, isStaticMethods inherited from interface Features.Pairs
isPairwiseMethods inherited from interface Features.Payoffs
getMap2Fitness, getMaxMonoPayoff, getMaxPayoff, getMinMonoPayoff, getMinPayoff, isNeutralMethods inherited from interface HasDistribution
getNTraits, getTraitNameMethods inherited from interface HasHistogram
getCustomLevels, getNTraits, getTraitColorsMethods inherited from interface IBS.HasIBS
createIBSMethods 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:ModuleLoad new module and perform basic initializations.- Overrides:
loadin classContinuous- See Also:
-
unload
public void unload()Description copied from class:ModuleUnload module and free all resources.- Overrides:
unloadin classContinuous- See Also:
-
getKey
Description copied from class:ModuleReturns identifier of the active module. For example, 2x2 games inTBTreturn "2x2". This corresponds to the argument for the--moduleoption to load a particular module. The default is to use the class name. -
getAuthors
Description copied from class:ModuleReturns a string with information about the authors of the module.- Overrides:
getAuthorsin classModule- Returns:
- the names of the authors
-
getTitle
Description copied from interface:FeaturesReturns title of active module, e.g. 2x2 games inTBTreturns "2x2 Games". -
pairScores
public double pairScores(double[] me, double[] groupTraits, int len, double[] groupPayoffs) Description copied from interface:IBS.HasIBS.MCPairsCalculate the payoff/score for modules with interactions in pairs and multiple continuous traits. The focal individual has traitsmeand the traits of itsleninteraction 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*nTraitsentries. The payoffs/scores for each of thelenopponent traits must be stored and returned in the arraypayoffs.Note:
Only the firstlenentries ingroupare guaranteed to exist and have meaningful values. The population structure may restrict the size of the interaction group.len≤nGroupalways 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:
pairScoresin 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
-