Class scanCSD
- All Implemented Interfaces:
Runnable
,IBS.HasIBS
,IBS.HasIBS.CPairs
,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
- 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 TypeFieldDescription(package private) double
The last value of theb1
benefit parameter.(package private) double
The increment of theb1
benefit parameter.(package private) boolean
The flag to indicate whether to use logarithmic increments for theb1
benefit parameter.(package private) double
The first value of theb1
benefit parameter.(package private) double
The last value of theb2
benefit parameter.(package private) double
The increment of theb2
benefit parameter.(package private) boolean
The flag to indicate whether to use logarithmic increments for theb2
benefit parameter.(package private) double
The first value of theb2
benefit parameter.(package private) double
The last value of thec1
cost parameter.(package private) double
The increment of thec1
cost parameter.(package private) boolean
The flag to indicate whether to use logarithmic increments for thec1
cost parameter.(package private) double
The first value of thec1
cost parameter.(package private) double
The last value of thec2
cost parameter.(package private) double
The increment of thec2
cost parameter.(package private) boolean
The flag to indicate whether to use logarithmic increments for thec2
cost parameter.(package private) double
The first value of thec2
cost parameter.final CLOption
Command line option to set the benefit parameterb1
, or its range or its range to scan.final CLOption
Command line option to set the benefit parameterb2
, or its range or its range to scan.final CLOption
Command line option to set the number of bins for the distribution (histogram).final CLOption
Command line option to set the cost parameterc1
, or its range or its range to scan.final CLOption
Command line option to set the cost parameterc2
, or its range or its range to scan.final CLOption
The command line option to print the trait distribution.final CLOption
Command line option to show the simulation progress.final CLOption
The command line option to set the interval for snapshots.(package private) IBSCPopulation
The population with continuous traits.(package private) int
The number of bins for the histogram.(package private) PrintStream
The output stream.(package private) boolean
The flag to indicate whether to print the distribution.(package private) boolean
The flag to indicate whether to show progress.(package private) int
The interval for snapshots.final int
The index of the mean trait.final int
The index of the standard deviation.Fields inherited from class Continuous
cloBenefits, cloCosts, cloTraitRange, cxMaxMonoScore, cxMaxScore, cxMinMonoScore, cxMinScore, extremalScoresSet, mutation, traitMax, traitMin, traits2payoff
Fields inherited from class Module
cloDeathRate, cloGeometry, cloNGroup, cloNPopulation, cloPhase2DAxis, cloSpeciesUpdateRate, cloTraitColors, cloTraitDisable, cloTraitNames, competition, deathRate, defaultColor, engine, interaction, logger, map2fitness, markers, model, nActive, name, nGroup, nPopulation, nTraits, playerUpdate, speciesUpdateRate, structure, traitColor, trajectoryColor, VACANT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
collectCLO
(CLOParser parser) All providers of command line options must implement this method to collect their options.static void
Main method to run the simulation.protected File
openSnapshot
(String ext) Open file for exporting the snapshot.void
printState
(double[] stat, double[] low) Print the distributions of the strategies.void
run()
void
Save snapshot of current configuration.Methods inherited from class CSD
getAuthors, getKey, getTitle, load, pairScores
Methods inherited from class Continuous
add, check, getMaxGameScore, getMaxMonoGameScore, getMinGameScore, getMinMonoGameScore, getMutation, getTraitMax, getTraitMin, setExtremalScores, setTraitRange, unload
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, 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
-
b1Start
double b1StartThe first value of theb1
benefit parameter. -
b1End
double b1EndThe last value of theb1
benefit parameter. -
b1Incr
double b1IncrThe increment of theb1
benefit parameter. -
b1Log
boolean b1LogThe flag to indicate whether to use logarithmic increments for theb1
benefit parameter. -
b2Start
double b2StartThe first value of theb2
benefit parameter. -
b2End
double b2EndThe last value of theb2
benefit parameter. -
b2Incr
double b2IncrThe increment of theb2
benefit parameter. -
b2Log
boolean b2LogThe flag to indicate whether to use logarithmic increments for theb2
benefit parameter. -
c1Start
double c1StartThe first value of thec1
cost parameter. -
c1End
double c1EndThe last value of thec1
cost parameter. -
c1Incr
double c1IncrThe increment of thec1
cost parameter. -
c1Log
boolean c1LogThe flag to indicate whether to use logarithmic increments for thec1
cost parameter. -
c2Start
double c2StartThe first value of thec2
cost parameter. -
c2End
double c2EndThe last value of thec2
cost parameter. -
c2Incr
double c2IncrThe increment of thec2
cost parameter. -
c2Log
boolean c2LogThe flag to indicate whether to use logarithmic increments for thec2
cost parameter. -
nBins
int nBinsThe number of bins for the histogram. -
printDistr
boolean printDistrThe flag to indicate whether to print the distribution. -
snapinterval
int snapintervalThe interval for snapshots. Disabled ifsnapinterval ≤ 0
. -
progress
boolean progressThe flag to indicate whether to show progress. -
cpop
IBSCPopulation cpopThe population with continuous traits. -
out
PrintStream outThe output stream. Defaults toSystem.out
. -
TRAIT_MEAN
public final int TRAIT_MEANThe index of the mean trait.- See Also:
-
TRAIT_SDEV
public final int TRAIT_SDEVThe index of the standard deviation.- See Also:
-
cloC1
Command line option to set the cost parameterc1
, or its range or its range to scan. -
cloC2
Command line option to set the cost parameterc2
, or its range or its range to scan. -
cloB1
Command line option to set the benefit parameterb1
, or its range or its range to scan. -
cloB2
Command line option to set the benefit parameterb2
, or its range or its range to scan. -
cloBins
Command line option to set the number of bins for the distribution (histogram). -
cloDistribution
The command line option to print the trait distribution. -
cloSnapInterval
The command line option to set the interval for snapshots. -
cloProgress
Command line option to show the simulation progress.
-
-
Constructor Details
-
scanCSD
Create a new scanCSD simulation.- Parameters:
engine
- the pacemaker for running the model
-
-
Method Details
-
run
public void run()Description copied from class:Module
Default 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 injar
file. -
printState
public void printState(double[] stat, double[] low) Print the distributions of the strategies. In order to identify bi-stability two complementary runs with low and high initial investments are required. In all other cases, thelow
isnull
.- Parameters:
stat
- the trait distributionlow
- the trait distribution for low investments
-
collectCLO
Description copied from interface:CLOProvider
All 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, theparser
issues 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:
collectCLO
in interfaceCLOProvider
- Overrides:
collectCLO
in classContinuous
- Parameters:
parser
- the reference to parser that manages command line options- See Also:
-
saveSnapshot
public void saveSnapshot()Save snapshot of current configuration. The snapshot is saved in the PNG format for lattices and in the SVG format for generic graphs.- 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
-