About

This script was tested and works on OpenSim version 0.7.4!

This is a chromosome shuffler system used on the science grid. It shuffles chromosome pairs such as AA,bb,CC,cc,DD and dd randomly. For example a possible configuration would be:

AA aa
bb BB
CC cc
DD dd

as well as:

aa AA
BB bb
CC cc
dd DD

The way the script works, is that each chromosome row is indexed with a number. The a pair chromosome, for example, is the first row. The main script generates a random binary string such as:

0110

and sends that string through the linkset. Each row then picks up this string and selects the digit corresponding to that row. For example, the a pair chromosome row will take the first digit 0. If that digit has the value of 0, then no shuffling will be done. If that digit has the value 1, then the row will shuffle and "AA" will exchange position with aa.

Setup

  • The shuffle script should be placed in the root of the build.
  • The local coordinates (llGetLocalPos) of each chromosome pair will have to be added to each script.
  • The vectors at the top of the chromosome script represent each slab's right position, respectively left position (For developers: this could be done differently by inverting the coordinates relative to the rezzer and perhaps eliminating half the need to manually enter coordinates).

Code: Chromosome shuffle

chromosome_shuffle.lsl
///////////////////////////////////////////////////////////////////////////
//  Copyright (C) Wizardry and Steamworks 2011 - License: GNU GPLv3      //
//  Please see: http://www.gnu.org/licenses/gpl.html for legal details,  //
//  rights of fair usage, the disclaimer and warranty conditions.        //
///////////////////////////////////////////////////////////////////////////
 
default
{
    touch_start(integer num)
    {
        integer itra;
        list reconf;
        for(itra=0; itra<4; ++itra) {
            reconf += (string)llFloor(llFrand(2));
        }
        llMessageLinked(LINK_ALL_CHILDREN, 0, llList2CSV(reconf), "k@reconf");
    }
}

Chromosome Script

chromosome_listner.lsl
///////////////////////////////////////////////////////////////////////////
//  Copyright (C) Wizardry and Steamworks 2011 - License: GNU GPLv3      //
//  Please see: http://www.gnu.org/licenses/gpl.html for legal details,  //
//  rights of fair usage, the disclaimer and warranty conditions.        //
///////////////////////////////////////////////////////////////////////////
 
vector left = <.455429,1.375748,-.020874>;
vector right = <-.276947,1.375740,-.020874>;
integer row =2;
 
default
{
    link_message(integer sender_num, integer num, string str, key id)
    {
        if(id != "k@reconf") return;
        integer theDo = llList2Integer(llParseString2List(str, [","], [""]), row);
        if(!theDo) return;
 
        if(llVecDist(llGetLocalPos(), left)<.2) {
            llSetPos(right);
            return;
        }
        if(llVecDist(llGetLocalPos(), right)<.2) {
            llSetPos(left);
            return;
        }
    }
}

secondlife/chromosome_shuffler.txt ยท Last modified: 2022/11/24 07:45 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.