Class simTBT
- All Implemented Interfaces:
Runnable,ChangeListener,IBS.HasIBS,IBS.HasIBS.DPairs,MilestoneListener,Model.HasDE,Model.HasDE.DPairs,Model.HasDE.EM,Model.HasDE.ODE,Model.HasDE.PDE,Model.HasDE.PDEADV,Model.HasDE.PDERD,Model.HasDE.RK5,Model.HasDE.SDE,Features,Features.Pairs,Features.Payoffs,HasHistogram,HasHistogram.Degree,HasHistogram.Fitness,HasHistogram.StatisticsProbability,HasHistogram.StatisticsStationary,HasHistogram.StatisticsTime,HasMean,HasMean.Fitness,HasMean.Traits,HasPop2D,HasPop2D.Fitness,HasPop2D.Traits,HasPop3D,HasPop3D.Fitness,HasPop3D.Traits,CLOProvider
- Author:
- Christoph Hauert
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class TBT
TBT.IBSPopNested classes/interfaces inherited from interface ChangeListener
ChangeListener.PendingActionNested classes/interfaces inherited from interface Features
Features.Groups, Features.Multispecies, Features.Pairs, Features.Payoffs, Features.StaticNested 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.MCPairsNested classes/interfaces inherited from interface Model.HasDE
Model.HasDE.DGroups, Model.HasDE.DPairs, Model.HasDE.DualDynamics, Model.HasDE.EM, Model.HasDE.ODE, Model.HasDE.PDE, Model.HasDE.PDEADV, Model.HasDE.PDERD, Model.HasDE.RK5, Model.HasDE.SDE -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal CLOptionCommand line option to show the simulation progress.final CLOptionCommand line option to set the number of runs.final CLOptionCommand line option to scan the donation game.final CLOptionCommand line option to scan the S-T-plane.final CLOptionCommand line option to set the interval for taking snapshots.final CLOptionCommand line option to set the prefix for snapshot filenames.(package private) IBSThe two player, two trait model.(package private) double[]Temporary variables for fixation probabilities and absorption times.(package private) double[]Temporary variables for fixation probabilities and absorption times.(package private) double[]Temporary variables for fixation probabilities and absorption times.(package private) intThe number of runs.(package private) PrintStreamThe output stream.(package private) doubleTime of previous sample.(package private) booleanThe flag to indicate whether to show progress.(package private) double[]The scan parameters for the donation game.(package private) double[]The scan parameters for the S-T-plane.(package private) longThe interval for saving snapshots.(package private) StringThe prefix for snapshot filenames.(package private) double[]Temporary variables for fixation probabilities and absorption times.(package private) double[]Temporary variables for fixation probabilities and absorption times.Fields inherited from class TBT
cloPayoffs, COOPERATE, DEFECTFields inherited from class Discrete
cloMonoStop, monoStop, mutationFields inherited from class Module
cloDeathRate, cloGeometry, cloNGroup, cloNPopulation, cloPhase2DAxes, cloTraitColors, cloTraitDisable, cloTraitNames, competition, deathRate, defaultColor, engine, interaction, logger, map2fitness, markers, model, nActive, name, nGroup, nPopulation, nTraits, playerUpdate, structure, traitColor, trajectoryColor, VACANT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcollectCLO(CLOParser parser) All providers of command line options must implement this method to collect their options.static voidMain method to run the simulation.voidmodelChanged(ChangeListener.PendingAction pending) Called whenever the state of the EvoLudo model changed.voidCalled after a running EvoLudo model stopped because the model converged (or reached an absorbing state).protected FileopenSnapshot(String ext) Open file for exporting the snapshot.voidrun()voidsaveSnapshot(int format) Save snapshot of current configuration.Methods inherited from class TBT
adjustCLO, avgScores, createIBSPop, getAuthors, getDependent, getKey, getMaxPayoff, getMeanColors, getMinPayoff, getMonoPayoff, getPayoff, getPayoffs, getTitle, getTraitName, load, mixedScores, pairScores, setPayoff, setPayoffs, unloadMethods inherited from class Discrete
add, getMaxMonoPayoff, getMinMonoPayoff, getMonoStop, getMutation, setMonoStopMethods inherited from class Module
check, createGeometry, createModel, getActiveTraits, getCompetitionGeometry, getDeathRate, getGeometry, getIBSPopulation, getID, getInteractionGeometry, getMap2Fitness, getMarkers, getModelTypes, getNActive, getName, getNGroup, getNPopulation, getNRoles, getNSpecies, getNTraits, getOpponent, getPlayerUpdate, getSpecies, getSpecies, getTraitColor, getTraitColors, getTraitNames, getTrajectoryColor, getVacant, init, processColorMap, reset, 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 Features
isMultispecies, isStaticMethods inherited from interface Features.Pairs
isPairwiseMethods inherited from interface Features.Payoffs
getMap2Fitness, getMaxMonoPayoff, getMinMonoPayoff, isNeutralMethods inherited from interface HasHistogram
getCustomLevels, getNTraits, getTraitColorsMethods inherited from interface IBS.HasIBS
createIBSMethods inherited from interface MilestoneListener
modelDidInit, modelDidReset, modelLoaded, modelRelaxed, modelRunning, modelSettings, modelUnloaded, moduleLoaded, moduleRestored, moduleUnloaded
-
Field Details
-
progress
boolean progressThe flag to indicate whether to show progress. -
nRuns
int nRunsThe number of runs. -
scanST
double[] scanSTThe scan parameters for the S-T-plane. -
scanDG
double[] scanDGThe scan parameters for the donation game. -
ibs
IBS ibsThe two player, two trait model. -
snapinterval
long snapintervalThe interval for saving snapshots. -
snapprefix
String snapprefixThe prefix for snapshot filenames. -
out
PrintStream outThe output stream. Defaults toSystem.out. -
mean
double[] meanTemporary variables for fixation probabilities and absorption times. -
var
double[] varTemporary variables for fixation probabilities and absorption times. -
state
double[] stateTemporary variables for fixation probabilities and absorption times. -
meanmean
double[] meanmeanTemporary variables for fixation probabilities and absorption times. -
meanvar
double[] meanvarTemporary variables for fixation probabilities and absorption times. -
prevsample
double prevsampleTime of previous sample. -
cloProgress
Command line option to show the simulation progress. -
cloSnapInterval
Command line option to set the interval for taking snapshots. -
cloSnapPrefix
Command line option to set the prefix for snapshot filenames. -
cloRuns
Command line option to set the number of runs. -
cloScanST
Command line option to scan the S-T-plane. -
cloScanDG
Command line option to scan the donation game.
-
-
Constructor Details
-
simTBT
Create a new simulation to investigate the two player, two trait model.- Parameters:
engine- the pacemaker for running the model
-
-
Method Details
-
run
public void run()Description copied from class:ModuleDefault run-loop for modules. Opportunity to override in subclasses for running customized simulations. Currently only called from
EvoLudoJRE.simulation()if custom simulation class is specified injarfile. -
modelChanged
Description copied from interface:ChangeListenerCalled whenever the state of the EvoLudo model changed. Process potentially pending requests.Note: the model may process some pending actions directly and without notifying the listeners through
modelChanged(PendingAction)first. In particular, this applies to pending actions that fire their own notifications, such asRESETandINITthat in turn triggermodelReset()andmodelInit(), respectively.- Specified by:
modelChangedin interfaceChangeListener- Parameters:
pending- pending action that needs to be processed.- See Also:
-
modelStopped
public void modelStopped()Description copied from interface:MilestoneListenerCalled after a running EvoLudo model stopped because the model converged (or reached an absorbing state).- Specified by:
modelStoppedin interfaceMilestoneListener
-
collectCLO
Description copied from interface:CLOProviderAll providers of command line options must implement this method to collect their options.Each command line option is (uniquely) identified by it's name (see
CLOption.getName()), which corresponds to the long version of the option. If an attempt is made to add an option with a name that already exists, theparserissues a warning and ignores the option. Thus, in general, implementing subclasses should first register their options and callsuper.collectCLO(CLOParser)at the end such that subclasses are able to override command line options specified in a parental class.Override this method in subclasses to add further command line options. Subclasses must make sure that they include a call to super.
- Specified by:
collectCLOin interfaceCLOProvider- Overrides:
collectCLOin classTBT- Parameters:
parser- the reference to parser that manages command line options- See Also:
-
saveSnapshot
public void saveSnapshot(int format) Save snapshot of current configuration.- Parameters:
format- the format of the snapshot- See Also:
-
openSnapshot
Open file for exporting the snapshot.- Parameters:
ext- the file extension- Returns:
- the file for the snapshot
-
main
Main method to run the simulation.- Parameters:
args- the array of command line arguments
-