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

public class scanCSD extends CSD
Simulations of the evolution of continuous investement levels in social dilemmas.
Author:
Christoph Hauert
See Also:
  • "Doebeli, M., Hauert, C., Killingback, T. (2004) <em>The evolutionary origin of cooperators and defectors.</em> Science 306:859-862. doi: <a href= 'https://doi.org/10.1126/science.1101456'>10.1126/science.1101456</a>"
  • "Hauert, C., Doebeli, M. (2021) <em>Spatial social dilemmas promote diversity</em> Proc. Natl. Acad. Sci. USA 118 (42) e2105252118. <a href='https://doi.org/10.1073/pnas.2105252118'>doi: 10.1073/pnas.2105252118</a>"
  • Field Details

    • b1Start

      double b1Start
      The first value of the b1 benefit parameter.
    • b1End

      double b1End
      The last value of the b1 benefit parameter.
    • b1Incr

      double b1Incr
      The increment of the b1 benefit parameter.
    • b1Log

      boolean b1Log
      The flag to indicate whether to use logarithmic increments for the b1 benefit parameter.
    • b2Start

      double b2Start
      The first value of the b2 benefit parameter.
    • b2End

      double b2End
      The last value of the b2 benefit parameter.
    • b2Incr

      double b2Incr
      The increment of the b2 benefit parameter.
    • b2Log

      boolean b2Log
      The flag to indicate whether to use logarithmic increments for the b2 benefit parameter.
    • c1Start

      double c1Start
      The first value of the c1 cost parameter.
    • c1End

      double c1End
      The last value of the c1 cost parameter.
    • c1Incr

      double c1Incr
      The increment of the c1 cost parameter.
    • c1Log

      boolean c1Log
      The flag to indicate whether to use logarithmic increments for the c1 cost parameter.
    • c2Start

      double c2Start
      The first value of the c2 cost parameter.
    • c2End

      double c2End
      The last value of the c2 cost parameter.
    • c2Incr

      double c2Incr
      The increment of the c2 cost parameter.
    • c2Log

      boolean c2Log
      The flag to indicate whether to use logarithmic increments for the c2 cost parameter.
    • nBins

      int nBins
      The number of bins for the histogram.
    • printDistr

      boolean printDistr
      The flag to indicate whether to print the distribution.
    • snapinterval

      int snapinterval
      The interval for snapshots. Disabled if snapinterval &le; 0.
    • progress

      boolean progress
      The flag to indicate whether to show progress.
    • cpop

      The population with continuous traits.
    • out

      The output stream. Defaults to System.out.
    • TRAIT_MEAN

      public final int TRAIT_MEAN
      The index of the mean trait.
      See Also:
    • TRAIT_SDEV

      public final int TRAIT_SDEV
      The index of the standard deviation.
      See Also:
    • cloC1

      public final CLOption cloC1
      Command line option to set the cost parameter c1, or its range or its range to scan.
    • cloC2

      public final CLOption cloC2
      Command line option to set the cost parameter c2, or its range or its range to scan.
    • cloB1

      public final CLOption cloB1
      Command line option to set the benefit parameter b1, or its range or its range to scan.
    • cloB2

      public final CLOption cloB2
      Command line option to set the benefit parameter b2, or its range or its range to scan.
    • cloBins

      public final CLOption cloBins
      Command line option to set the number of bins for the distribution (histogram).
    • cloDistribution

      public final CLOption cloDistribution
      The command line option to print the trait distribution.
    • cloSnapInterval

      public final CLOption cloSnapInterval
      The command line option to set the interval for snapshots.
    • cloProgress

      public final CLOption cloProgress
      Command line option to show the simulation progress.
  • Constructor Details

    • scanCSD

      public scanCSD(EvoLudo engine)
      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 in jar file.

      Specified by:
      run in interface Runnable
      Overrides:
      run in class Module
    • 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, the low is null.
      Parameters:
      stat - the trait distribution
      low - the trait distribution for low investments
    • collectCLO

      public void collectCLO(CLOParser parser)
      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, the parser issues a warning and ignores the option. Thus, in general, implementing subclasses should first register their options and call super.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 interface CLOProvider
      Overrides:
      collectCLO in class Continuous
      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:
      • MVPop2D
    • openSnapshot

      protected File openSnapshot(String ext)
      Open file for exporting the snapshot.
      Parameters:
      ext - the file extension
      Returns:
      the file for the snapshot
    • main

      public static void main(String[] args)
      Main method to run the simulation.
      Parameters:
      args - the array of command line arguments