Population class, available in: Global contextA set of Creature objects, sharing some high level simulation properties (performance calculation, NN simulation, collision detection, event handling). The groups usually have different roles in the experiment (e.g. Creatures groups and Food group in standard.expdef).
You can iterate directly over Creatures in a Population using for(...in...) loops:
    for(var c in Populations[0]) Simulator.print(c.name);
This class has 41 members:
sdleiF
int bodysim0 .. 1 (false/true)
default=1
Body simulationReplaced by initial_physics_active
int colmask0 .. 65535
default=0
Collision maskYou should use selfmask and othermask instead of colmask (these masks are also much easier to understand than the old colmask field).
int death0 .. 1 (false/true)
default=1
DeathDo creatures die when no energy?
float em_dyn0 .. 1
default=0.0
Muscle dynamic workEnergy consumption of a muscle moving a stick, calculated from the actual work performed by the muscle. Muscles must move to consume this kind of energy.
float em_stat0 .. 1
default=0.0
Muscle static workEnergy consumption of a muscle resisting an external force (whether performing or not performing any physical work). Framsticks muscles cannot be "turned off", but they can stop consuming "static" energy when the body part keeps itself in the requested position without stressing the muscle, e.g. when floating in the water or resting freely on the ground.
float en_assim0 .. 1
default=0.0
Assimilation productivityMaximal energy gain produced by a vertical specialized stick.
Horizontal specialized sticks get half of this value.
int enableperf0 .. 2
  • 0 = Off
  • 1 = Immediate (default)
  • 2 = After stabilization
  • Performance calculationReplaced by initial_perf_measuring
    int energy0 .. 1 (false/true)
    default=1
    Energy calculationIf turned off, creature's energy will be constant.
    int index ROpopulation index
    int initial_nn_active0 .. 2
  • 0 = Off
  • 1 = Immediate (default)
  • 2 = After stabilization
  • Neural net simulationStabilization means no significant movement during a specified period of time. See http://www.framsticks.com/a/al_params.html#exper-perfcalc
    int initial_perf_measuring0 .. 2
  • 0 = Off
  • 1 = Immediate (default)
  • 2 = After stabilization
  • Performance calculationStabilization means no significant movement during a specified period of time. See http://www.framsticks.com/a/al_params.html#exper-perfcalc
    int initial_physics_active0 .. 1 (false/true)
    default=1
    Body simulationEnable/disable physical body simulation. This is the initial value of Creature.physics_active for all objects created in this group. For details, see the documentation of Creature.physics_active.
    int initial_self_collisions0 .. 1 (false/true)
    default=0
    Detect self-collisionsDetect collisions within creature bodies (only applicable for the ODE simulation engine). This is the initial value of Creature.self_collisions for all objects created in this group. If enabled, creatures with self-colliding genotypes are not born, and others will have their sticks collide during lifespan.
    object iterator ROiterator
    int killnostable0 .. 10000000
    default=1000000
    Kill if no stabilization afterCreatures that fail to stabilize after the specified waiting period (e.g. because they are continuously rolling) will be killed. 0 disables this feature.
    string nameGroup name
    int nn_paused0 .. 1 (false/true)
    default=0
    Neural net pausedDisables NN simulation for all creatures in the population
    int nnsim0 .. 2
  • 0 = Off
  • 1 = Immediate (default)
  • 2 = After stabilization
  • Neural net simulationReplaced by initial_nn_active
    int othermask0 .. 2147483647
    default=0
    Collision mask (other)See selfmask.
    int perfperiod0 .. 1000000
    default=100
    Performance sampling periodDefines how often onUpdate() events are called and how often the built-in performance counters (distance, speed, etc.) are calculated. See http://www.framsticks.com/a/al_params.html#exper-perfcalc
    int selfcol0 .. 1 (false/true)
    default=0
    Detect self-collisionsReplaced by initial_self_collisions
    int selfmask0 .. 2147483647
    default=0
    Collision mask (self)Collisions between objects can be handled in two ways:
    - standard 'mechanical' collision handler (simple 'rebound' effect)
    - special script handler (On[GROUPNAME]Collision function)

    In the script handler function, use the Collision object to access the two colliding parts of two creatures.
    The first part in the Collision object (i.e. Collision.Creature1) always concerns the creature that belongs to [GROUPNAME].
    The handler is called once for each creature that collides with the creature from [GROUPNAME].

    Collision masks that you set determine which handler will be used (none and both are also possible). On each collision, selfmask and othermask of the colliding objects are logically ANDed.
    If the resulting non-zero value falls into 16 lower bits (0x0000ffff), the standard handler is enabled.
    If the resulting non-zero value falls into 16 higher bits (0xffff0000), the custom handler is enabled.

    Examples:

    1.With one group, all possible combinations of the collision handlers are as follows:
        - ignore collisions (e.g. selfmask=othermask=0)
        - use standard handling (e.g. selfmask=othermask=1)
        - use custom handling (e.g. selfmask=othermask=0x10000)
        - use standard and custom handling (e.g. selfmask=othermask=0x10001)

    2.Two groups yield more interesting cases. Let us consider the 'standard.expdef' setting:
        Creatures: selfmask=0x10001, othermask=0x20001
        Food: selfmask=0x20002, othermask=0x10002
    There are three possible scenarios:
        - creature and creature: collision value = 0x10001 & 0x20001 = 1 -> Standard handling will be used (1 is one of the lower 16 bits)
        - food and food: collision value = 0x20002 & 0x10002 = 2 -> As above.
        - creature and food: collision value = (0x10001 & 0x10002) or (0x20002 & 0x20001) = 0x10000 or 0x20000 -> Custom handling will be used (the result falls into higher 16 bits).


    Instead of manually calculating mask values, you can use this interactive graphical helper: http://www.framsticks.com/files/apps/js/population-mask-helper/index.html
    int size RONumber of creatures
    int stabilperiod0 .. 1000000
    default=100
    Sampling period while waiting"Performance sampling period" for the stabilization phase.
    float stabledist0 .. 1
    default=0.01
    Allowed distance to be stableA creature is considered stabilized when its center of gravity stays within the specified distance after the "Sampling period while waiting" has elapsed.
    snoitcnuF
    function add(untyped Genotype_object_or_Geno_object_or_string_genotype_or_CreatureSnapshot_object)returns CreatureaddAdding CreatureSnapshot object automatically copies the CreatureSnapshot fields into the Creature, including creature location (the center of the bounding box is preserved) and orientation.
    See also: CreatureSnapshot
    function canAdd(untyped Genotype_object_or_Geno_object_or_string_genotype_or_CreatureSnapshot_object, int treat_warnings_as_errors, int mute)returns intcanAddCheck if the creature could be built from the supplied argument, as if add() was called - this is equivalent to add()ing a creature and immediately removing it, but without the side effects of onBorn().
    The mandatory second argument means: -1=obey the current simulator setting for "Don't simulate genotypes with warnings", 0=warnings during creature building are acceptable, 1=treat such warnings as a build failure (cannot add).
    Errors/warnings are emitted like in add(), unless mute=1.
    function clear()doesn't return a valueDelete all creatures
    function createFromGeno(Geno)returns CreatureUses the supplied Geno object.
    Deprecated. Use the more universal add() function.
    function createFromGenotype()returns CreatureUses the selected Genotype object.
    Deprecated. Use the more universal add() function.
    function createFromString(string genotype)returns CreatureUses the supplied string argument.
    Deprecated. Use the more universal add() function.
    function delete(untyped Creature_object_or_index)doesn't return a valueDelete the creature (remove it without executing the onKill event). Removing creatures inside some event handlers (e.g. onCollision) might be unsafe.
    function findCreatureAt(Vector point, Vector vector)returns CreatureFind creatureReturns the first Creature object colliding with the line defined by the supplied starting point and the vector. For the purpose of this function, "collision" means "passing closer than 1.0 from any of the Creature's Parts".
    Note that a screen point corresponds to a 3D line going through the screen surface; if you want to identify the object under the mouse cursor, you can use this function because finding an object at a given screen coordinates can be a special case of finding the line-with-object collision.
    function findUID(string uid)returns intFind a Creature by UID
    function get(int index)returns Creatureget creature object
    function getStatsAvg(string field_name)returns floatget stats averageRetrieves data from stats.* object. Can only be used for fields covered by stats.* (subset of Creature fields).
    function getStatsMax(string field_name)returns floatget stats maximumRetrieves data from stats.* object. Can only be used for fields covered by stats.* (subset of Creature fields).
    function getStatsMin(string field_name)returns floatget stats minimumRetrieves data from stats.* object. Can only be used for fields covered by stats.* (subset of Creature fields).
    function kill(untyped Creature_object_or_index)doesn't return a valueKill the creature (remove it and execute its onKill handler). Killing creatures inside some event handlers (e.g. onCollision) might be unsafe. The recommended and safe way of killing a creature is by setting its energy to 0.
    function refreshGUI()doesn't return a valueRefresh GUINotify list content changed
    function senseCreaturesProperty(float x, float y, float z, string propertyname, Creature exclude)returns floatsenseCreaturesPropertyArguments:
    - x,y,z (sensor position)
    - property (name, data[key] or Class:id). "data[key]" can be used to access Creature's data field (Dictionary) containing named items
    - exclude (creature object)

    This function works like a smell sensor (but you can provide any property as the argument, not just "energy") for all creatures in this group except "exclude".
    The following is a sample function that reproduces the "S" sensor which smells creatures from all populations:
        function smellEnergyAllPopulations(x, y, z, exclude)
        {
            var s=0;
            for(var i=0; i<Populations.size; i++)
                s += Populations[i].senseCreaturesProperty(x, y, z, "energy", exclude);
            return s;
        }
    Global context