Sugarscape
Class GoLconst

java.lang.Object
  extended bySugarscape.GoLconst

public class GoLconst
extends java.lang.Object

This file provides the most direct option to configure and manipulate the behavior and properties of objects in the Sugarscape simulation.
It allows a researcher to create an initial scenario and to tweak rules within that scenario. Collaborating researchers could set, evaluate, finalize these settings in order to enable others to duplicate, verify and critique conclusions drawn from these simulations.
The configuration is achieved through the use of global constants available to all objects on the Sugarscape. These constants can be broadly classified into the following categories

Author:
abraham kannankeril

Field Summary
static boolean CELL_3D
          Controls the appearence of individual cells
static int CELL_BAR
          Cell Bar color - bar represents sugar & spice quantity in cell
static int CELL_BG
          Cell Background Color
static int CITIZEN_COLOR_CHILD
           
static int CITIZEN_COLOR_SENIOR
          Determines RGB color value depicting senior citizens - past child-bearing age
static boolean CREATE_UNIQUE_SURNAMES
          Surnames are randomly generated from a list of 2000 names.
static boolean DEBUG
          This activates all debugging output, irrespective of the value of the rest of the DEBUG variables.
static boolean DEBUG_BARTER
          Enables output of subprocesses that comprise the barter function.
static boolean DEBUG_BARTER_EXCHANGE
          Enables output from the process finalizing the exchange of goods between citizens.
static boolean DEBUG_BARTER_SORT
          Enables output of process that evaluates, ranks and selects from multiple trade offers.
static boolean DEBUG_CITIZEN_BIRTH
          Enables output of subprocesses that comprise birth of a child.
static boolean DEBUG_CITIZEN_DEATH
           
static boolean DEBUG_CMD_FEEDBACK
          This determines whether the feedback to commands typed in by the user are generated and displayed.
static boolean DEBUG_CRITICAL_ERROR
          Controls display of critical system errors that invalidate results.
static boolean DEBUG_INHERITANCE
          Enables tracking of the inheritance process.
static boolean DEBUG_MATING
          Enables output of subprocesses that comprise the mating function.
static boolean DEBUG_MATING_BIRTH
          Enables output of processes that comprise the birth of a child after mating.
static boolean DEBUG_MATING_SEARCH
          Enables output of processes that comprise the search for a mate.
static boolean DEBUG_MATING_SELECTION
          Enables output of processes that comprise the selection of a mate.
static boolean DEBUG_POLLUTION
          Enables tracking of pollution accumulation and dispersal processes.
static boolean DEBUG_PROCESS_TIME
          Enables tracking of time taken by the major processes.
static boolean DEBUG_PROGRAM_FLOW
          Controls display of program flow by listing the names of major methods as they execute.
static boolean DEBUG_SEARCH_SUGAR
          Enables output of subprocesses that control the search for sugar.
static boolean DEBUG_SPICE_PRODUCTION
          Displays the actual distribution of spice at the start of each cycle.
static boolean DEBUG_SUGAR_PRODUCTION
          Displays the actual distribution of sugar at the start of each cycle.
static int demoCntr
           
static float DENSITY_FACTOR
          density of population used in the Random & Sugarscape template
static boolean flagDemo
          flag identifying (de)activation of the Demo/test process that enables a quick test or demonstration of the Sugarscape simulation.
static boolean flagOutFileCreated
          not used currently due to security restrictions on applets in Java.
static boolean flagSugarscape
          flag identifying (de)activation of the Sugarscape process from either the menu or the command line on the Sugarscape.
static int GRID_CELLSIZE
          Cell side in pixels, each cell is a square
static int GRID_COLS_MAX
          Maximum possible value for Sugarscape columns
static int GRID_COLUMNS
          Default value for Sugarscape columns
static java.lang.String GRID_COORD_COLOR
          available options - blue, black, red, green
static int GRID_COORD_DETAIL
          0->all cells, 1->last row&col, 2->last col, 3->last row, 4->last cell
static float GRID_COORD_FONT
          determines font size, range .5(small)--> .9(large), default .8
static boolean GRID_COORD_SHOW
          switches grid coordinates on / off.
static float GRID_FERTILITY_SPICE
           
static float GRID_FERTILITY_SUGAR
          Grid fertility for sugar - percentage of cells that will grow sugar.
static int GRID_REFRESH_FAST
           
static int GRID_REFRESH_HYPER
           
static int GRID_REFRESH_SLOW
          Time-interval between timePeriod, value SLOW
static int GRID_ROWS
           
static int GRID_ROWS_MAX
           
static boolean INHERIT_FAMILY_FATHER
          Determines whose name is passed on to the progeny.
static boolean INHERIT_INITIAL_WEALTH
          Determines whether children inherit 1/2 of parents inheritance or 1/2 of parents entire wealth.
static boolean INITIATE_BARTER
          Barter Initiation switch.
static boolean INITIATE_GATHER
          Inheritance switch.
static boolean INITIATE_INHERITANCE
          Inheritance switch.
static boolean INITIATE_MATING
          Inheritance switch.
static boolean INITIATE_POLLUTION
          Switch for the pollution process.
static boolean INITIATE_SEASONS
          Climate Change Initiation, if false, its always summer
static int LIFE_EXPECTANCY_MAX
           
static int LIFE_EXPECTANCY_MIN
          Life Expectancy range - minimum value, people may die earlier from other causes.
static boolean LIMIT_CELL_SPICE
           
static boolean LIMIT_CELL_SUGAR
          if true, sugar accumulation is limited by capacity defined in SUGAR_MAX_CELL.
static int MATING_FEMALE_GAP
          waiting period that must elapse after mating before female citizens can resume mating.
static int MATING_FEMALE_MAX
          maximum mating age for female citizens, i.e., menopause
static int MATING_FEMALE_MIN
          minimum mating age for female citizens.
static boolean MATING_KIN_ALLOW
          Determines if mating is allowed among immediate kin (parent, child, sibling).
static int MATING_MALE_GAP
           
static int MATING_MALE_MAX
           
static int MATING_MALE_MIN
           
static int METABOLISM_MAX_SPICE
           
static int METABOLISM_MAX_SUGAR
          maximum sugar metabolism level for a citizen, minimum 1.
static java.lang.String OUTPUT_DESTINATION
          cannot implement due to java restrictions on applets
static float PERSONALITY_RATIO
          ratio of citizens that are risk-averse to risk-takers, influences trading strategy.
static float POLLUTION_DISPERSION_UNIT
          Dispersal / Pollution reduction per cell per year
static float POLLUTION_PRODUCTION_SPICE
           
static float POLLUTION_PRODUCTION_SUGAR
          Pollution generated in a cell per unit sugar gathered
static java.lang.String PROGRAM_RELEASE_DATE
          Public release date
static java.lang.String PROGRAM_VERSION
          Current Sugarscape Project Version #
static int SEASON_DURATION
          Duration in time periods of each season
static float SEX_RATIO
          ratio of females to males born
static int SPICE_LEVEL_POOR
           
static int SPICE_MAX_CELL
           
static int SPICE_MAX_CITIZEN
           
static int SPICE_MIN_CITIZEN
           
static float SPICE_RENEW_SUMMER
           
static float SPICE_RENEW_WINTER
           
static int SUGAR_LEVEL_POOR
          Wealth Level indicator for sugar (influences ranking), multiplier based on Metabolism.
static int SUGAR_MAX_CELL
          maximum "initial" qty of sugar in a cell, may exceed this limit later if LIMIT_CELL_SUGAR is false.
static int SUGAR_MAX_CITIZEN
          max "initial" qty of sugar inherited by a citizen - may gather more later
static int SUGAR_MIN_CITIZEN
          min "initial" qty of sugar inherited by a citizen - inheritance for first generation is derived randomly, later generations inherit from parents.
static float SUGAR_RENEW_SUMMER
          Unit increase in amt of sugar during summer
static float SUGAR_RENEW_WINTER
          Unit increase in amt of sugar during winter.
static int TEXTAREA_HEIGHT
          Default size in rows for text display & command feedback
static int TEXTAREA_MAX
           
static int TEXTAREA_MIN
           
static int timePeriod
           
static int VISION_MAX
          maximum vision level for a citizen , minimum 1
 
Constructor Summary
GoLconst()
           
 
Method Summary
static java.lang.String chkGoLconstants()
          Default set of checks attempts to determine if default settings for variables are valid.
static java.lang.String customFormat(java.lang.String pattern, double value)
          Method to format float and double vars for display on screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CELL_3D

public static boolean CELL_3D
Controls the appearence of individual cells


CELL_BAR

public static int CELL_BAR
Cell Bar color - bar represents sugar & spice quantity in cell


CELL_BG

public static int CELL_BG
Cell Background Color


CITIZEN_COLOR_CHILD

public static int CITIZEN_COLOR_CHILD

CITIZEN_COLOR_SENIOR

public static int CITIZEN_COLOR_SENIOR
Determines RGB color value depicting senior citizens - past child-bearing age


CREATE_UNIQUE_SURNAMES

public static boolean CREATE_UNIQUE_SURNAMES
Surnames are randomly generated from a list of 2000 names. This option determines whether the names are reused or assigned exclusively. This applies only to the first generation citizens, subsequent generations inherit surnames from one of their parents. This is determined by the INHERIT_FAMILY_FATHER variable. If the initial population exceeds the available surnames, then uniqueness is not an option. A longer list can be used, if needed.

See Also:
INHERIT_FAMILY_FATHER

DEBUG

public static boolean DEBUG
This activates all debugging output, irrespective of the value of the rest of the DEBUG variables. It is similar to a master switch. Avoid this option unless you absolutely need it as it will dramatically slow down the execution of the simulation. It may also cause a memory protection error if too much data is generated.


DEBUG_BARTER

public static boolean DEBUG_BARTER
Enables output of subprocesses that comprise the barter function.


DEBUG_BARTER_EXCHANGE

public static boolean DEBUG_BARTER_EXCHANGE
Enables output from the process finalizing the exchange of goods between citizens.


DEBUG_BARTER_SORT

public static boolean DEBUG_BARTER_SORT
Enables output of process that evaluates, ranks and selects from multiple trade offers.


DEBUG_CITIZEN_BIRTH

public static boolean DEBUG_CITIZEN_BIRTH
Enables output of subprocesses that comprise birth of a child.


DEBUG_CITIZEN_DEATH

public static boolean DEBUG_CITIZEN_DEATH

DEBUG_CMD_FEEDBACK

public static boolean DEBUG_CMD_FEEDBACK
This determines whether the feedback to commands typed in by the user are generated and displayed. Default true.


DEBUG_CRITICAL_ERROR

public static boolean DEBUG_CRITICAL_ERROR
Controls display of critical system errors that invalidate results. Default true.


DEBUG_INHERITANCE

public static boolean DEBUG_INHERITANCE
Enables tracking of the inheritance process.


DEBUG_MATING

public static boolean DEBUG_MATING
Enables output of subprocesses that comprise the mating function.


DEBUG_MATING_BIRTH

public static boolean DEBUG_MATING_BIRTH
Enables output of processes that comprise the birth of a child after mating.


DEBUG_MATING_SEARCH

public static boolean DEBUG_MATING_SEARCH
Enables output of processes that comprise the search for a mate.


DEBUG_MATING_SELECTION

public static boolean DEBUG_MATING_SELECTION
Enables output of processes that comprise the selection of a mate.


DEBUG_POLLUTION

public static boolean DEBUG_POLLUTION
Enables tracking of pollution accumulation and dispersal processes.


DEBUG_PROCESS_TIME

public static boolean DEBUG_PROCESS_TIME
Enables tracking of time taken by the major processes.


DEBUG_PROGRAM_FLOW

public static boolean DEBUG_PROGRAM_FLOW
Controls display of program flow by listing the names of major methods as they execute. If other debugging options are activated, the added feedback may make it harder to understand the program flow.


DEBUG_SEARCH_SUGAR

public static boolean DEBUG_SEARCH_SUGAR
Enables output of subprocesses that control the search for sugar.


DEBUG_SPICE_PRODUCTION

public static boolean DEBUG_SPICE_PRODUCTION
Displays the actual distribution of spice at the start of each cycle.


DEBUG_SUGAR_PRODUCTION

public static boolean DEBUG_SUGAR_PRODUCTION
Displays the actual distribution of sugar at the start of each cycle.


demoCntr

public static int demoCntr

DENSITY_FACTOR

public static float DENSITY_FACTOR
density of population used in the Random & Sugarscape template


flagDemo

public static boolean flagDemo
flag identifying (de)activation of the Demo/test process that enables a quick test or demonstration of the Sugarscape simulation.


flagOutFileCreated

public static boolean flagOutFileCreated
not used currently due to security restrictions on applets in Java.


flagSugarscape

public static boolean flagSugarscape
flag identifying (de)activation of the Sugarscape process from either the menu or the command line on the Sugarscape.


GRID_CELLSIZE

public static int GRID_CELLSIZE
Cell side in pixels, each cell is a square


GRID_COLS_MAX

public static int GRID_COLS_MAX
Maximum possible value for Sugarscape columns


GRID_COLUMNS

public static int GRID_COLUMNS
Default value for Sugarscape columns


GRID_COORD_COLOR

public static java.lang.String GRID_COORD_COLOR
available options - blue, black, red, green


GRID_COORD_DETAIL

public static int GRID_COORD_DETAIL
0->all cells, 1->last row&col, 2->last col, 3->last row, 4->last cell


GRID_COORD_FONT

public static float GRID_COORD_FONT
determines font size, range .5(small)--> .9(large), default .8


GRID_COORD_SHOW

public static boolean GRID_COORD_SHOW
switches grid coordinates on / off.


GRID_FERTILITY_SPICE

public static float GRID_FERTILITY_SPICE

GRID_FERTILITY_SUGAR

public static float GRID_FERTILITY_SUGAR
Grid fertility for sugar - percentage of cells that will grow sugar. This defines the ratio of fertile (sugar-growing) to barren cells.


GRID_REFRESH_FAST

public static int GRID_REFRESH_FAST

GRID_REFRESH_HYPER

public static int GRID_REFRESH_HYPER

GRID_REFRESH_SLOW

public static int GRID_REFRESH_SLOW
Time-interval between timePeriod, value SLOW


GRID_ROWS

public static int GRID_ROWS

GRID_ROWS_MAX

public static int GRID_ROWS_MAX

INHERIT_FAMILY_FATHER

public static boolean INHERIT_FAMILY_FATHER
Determines whose name is passed on to the progeny. If true, the father's name else the mother's name is is given to the child.


INHERIT_INITIAL_WEALTH

public static boolean INHERIT_INITIAL_WEALTH
Determines whether children inherit 1/2 of parents inheritance or 1/2 of parents entire wealth.


INITIATE_BARTER

public static boolean INITIATE_BARTER
Barter Initiation switch. This enables or disables trade on the Sugarscape.


INITIATE_GATHER

public static boolean INITIATE_GATHER
Inheritance switch. Wealth of dead citizens is divided among surviving children.


INITIATE_INHERITANCE

public static boolean INITIATE_INHERITANCE
Inheritance switch. Wealth of dead citizens is divided among surviving children.


INITIATE_MATING

public static boolean INITIATE_MATING
Inheritance switch. Wealth of dead citizens is divided among surviving children.


INITIATE_POLLUTION

public static boolean INITIATE_POLLUTION
Switch for the pollution process. As cells accumulate pollutant, they become less desirable to citizens. Pollution is caused by the food production / harvesting process. The pollution dispersal processes are also activated with pollution. The amount of pollution caused & dispersed is determined by the following variables.

See Also:
POLLUTION_PRODUCTION_SUGAR, POLLUTION_PRODUCTION_SPICE, POLLUTION_DISPERSION_UNIT

INITIATE_SEASONS

public static boolean INITIATE_SEASONS
Climate Change Initiation, if false, its always summer


LIFE_EXPECTANCY_MAX

public static int LIFE_EXPECTANCY_MAX

LIFE_EXPECTANCY_MIN

public static int LIFE_EXPECTANCY_MIN
Life Expectancy range - minimum value, people may die earlier from other causes.


LIMIT_CELL_SPICE

public static boolean LIMIT_CELL_SPICE

LIMIT_CELL_SUGAR

public static boolean LIMIT_CELL_SUGAR
if true, sugar accumulation is limited by capacity defined in SUGAR_MAX_CELL.


MATING_FEMALE_GAP

public static int MATING_FEMALE_GAP
waiting period that must elapse after mating before female citizens can resume mating. Can be set to 0, if no gap is desired.


MATING_FEMALE_MAX

public static int MATING_FEMALE_MAX
maximum mating age for female citizens, i.e., menopause


MATING_FEMALE_MIN

public static int MATING_FEMALE_MIN
minimum mating age for female citizens.


MATING_KIN_ALLOW

public static boolean MATING_KIN_ALLOW
Determines if mating is allowed among immediate kin (parent, child, sibling).


MATING_MALE_GAP

public static int MATING_MALE_GAP

MATING_MALE_MAX

public static int MATING_MALE_MAX

MATING_MALE_MIN

public static int MATING_MALE_MIN

METABOLISM_MAX_SPICE

public static int METABOLISM_MAX_SPICE

METABOLISM_MAX_SUGAR

public static int METABOLISM_MAX_SUGAR
maximum sugar metabolism level for a citizen, minimum 1.


OUTPUT_DESTINATION

public static java.lang.String OUTPUT_DESTINATION
cannot implement due to java restrictions on applets


PERSONALITY_RATIO

public static float PERSONALITY_RATIO
ratio of citizens that are risk-averse to risk-takers, influences trading strategy.

See Also:
persona

POLLUTION_DISPERSION_UNIT

public static float POLLUTION_DISPERSION_UNIT
Dispersal / Pollution reduction per cell per year


POLLUTION_PRODUCTION_SPICE

public static float POLLUTION_PRODUCTION_SPICE

POLLUTION_PRODUCTION_SUGAR

public static float POLLUTION_PRODUCTION_SUGAR
Pollution generated in a cell per unit sugar gathered


PROGRAM_RELEASE_DATE

public static java.lang.String PROGRAM_RELEASE_DATE
Public release date


PROGRAM_VERSION

public static java.lang.String PROGRAM_VERSION
Current Sugarscape Project Version #


SEASON_DURATION

public static int SEASON_DURATION
Duration in time periods of each season


SEX_RATIO

public static float SEX_RATIO
ratio of females to males born


SPICE_LEVEL_POOR

public static int SPICE_LEVEL_POOR

SPICE_MAX_CELL

public static int SPICE_MAX_CELL

SPICE_MAX_CITIZEN

public static int SPICE_MAX_CITIZEN

SPICE_MIN_CITIZEN

public static int SPICE_MIN_CITIZEN

SPICE_RENEW_SUMMER

public static float SPICE_RENEW_SUMMER

SPICE_RENEW_WINTER

public static float SPICE_RENEW_WINTER

SUGAR_LEVEL_POOR

public static int SUGAR_LEVEL_POOR
Wealth Level indicator for sugar (influences ranking), multiplier based on Metabolism. For eg. a value of 20 means citizens with less than (20*sugar metabolism) are considered poor in terms of their sugar wealth.


SUGAR_MAX_CELL

public static int SUGAR_MAX_CELL
maximum "initial" qty of sugar in a cell, may exceed this limit later if LIMIT_CELL_SUGAR is false.

See Also:
LIMIT_CELL_SUGAR

SUGAR_MAX_CITIZEN

public static int SUGAR_MAX_CITIZEN
max "initial" qty of sugar inherited by a citizen - may gather more later


SUGAR_MIN_CITIZEN

public static int SUGAR_MIN_CITIZEN
min "initial" qty of sugar inherited by a citizen - inheritance for first generation is derived randomly, later generations inherit from parents. Each parent contributes either 1/2 of their own initial inheritance or 1/2 of their total wealth at the time of child-birth. This is determined by the value of the INHERIT_INITIAL_WEALTH variable.

See Also:
INHERIT_INITIAL_WEALTH

SUGAR_RENEW_SUMMER

public static float SUGAR_RENEW_SUMMER
Unit increase in amt of sugar during summer


SUGAR_RENEW_WINTER

public static float SUGAR_RENEW_WINTER
Unit increase in amt of sugar during winter. Typically much lower than the unit increase in summer.


TEXTAREA_HEIGHT

public static int TEXTAREA_HEIGHT
Default size in rows for text display & command feedback


TEXTAREA_MAX

public static int TEXTAREA_MAX

TEXTAREA_MIN

public static int TEXTAREA_MIN

timePeriod

public static int timePeriod

VISION_MAX

public static int VISION_MAX
maximum vision level for a citizen , minimum 1

Constructor Detail

GoLconst

public GoLconst()
Method Detail

chkGoLconstants

public static java.lang.String chkGoLconstants()
Default set of checks attempts to determine if default settings for variables are valid.

Returns:
String listing all errors discovered and corrective action taken

customFormat

public static java.lang.String customFormat(java.lang.String pattern,
                                            double value)
Method to format float and double vars for display on screen.

Parameters:
pattern - format pattern.
value - float/double value to format.
Returns:
string containing formatted value.