Darwin 2: Guide to configuration

Part 2: Mendel's Peas

This document describes the contents of the MendelsPeas.xml resource which is used to define the model for the out-of-the-box exemplar for the Darwin framework. Please see configuration.html first, which will then refer to this file.

<?xml version="1.0" encoding="ISO-8859-1" ?>
<configuration>

At this point, we see a comment, reproduced here:

    <!--
        This file configures the model for the the out-of-the-box running of
        Darwin. It is an extremely simple evolution and its sole purpose is to
        have something which will run "out of the box" using all of the
        standard components (none of the classes used for beans have had to be
        extended to make this work). This file is included by outOfTheBox.xml.
    
-->

And (again) the beans tag...

    <beans>

The CensusTaker bean is responsible for reporting on the populations as generations succeed generations. This bean is referenced by the VisualizableListener and Darwin beans and accordingly implements the interface Census. The OOB application uses the standard implementation of Census which is able to report on basic information of a Darwinian system. For details of the constructor arguments and properties, see the API for Census_Detail.

        <bean id="CensusTaker" class="com.rubecula.darwin.domain.world.Census_Detail">
            <constructor-arg>
                <ref bean="_Writer_" />
            </constructor-arg>
        </bean>

The VisualizationListener bean is what reacts to population changes, or changes in the environment of a population. As it is visualizableListener member of the Evolution bean, it accordingly implements the interface VisualizationListener. In this case, we use the census bean to give us a census of the population at each of these events. Note that the visualization listener bean is made a "visualizableListener" member of the Evolution bean. In general, an Evolution object may have other visualizable listeners also. For details on the constructor args and properties, see the API documentation for VisualizableListener_Census

        <bean id="VisualizableListener"
            class="com.rubecula.darwin.domain.world.VisualizableListener_Census">
            <constructor-arg>
                <ref bean="CensusTaker" />
            </constructor-arg>
            <member membership="visualizableListener">!Evolution</member>
        </bean>

The MateChoice bean determines for the Pea system how mates are chosen. This bean is referenced by the Darwin bean and accordingly implements the interface MateChoice. For details on the constructor args and properties, see the API documentation for MateChoice_Wrightian.

        <bean id="MateChoice" class="com.rubecula.darwin.domain.world.MateChoice_Wrightian">
            <constructor-arg>
                <ref bean="Random" />
            </constructor-arg>
        </bean>

The Mortality bean determines which pea organisms live and which die. This bean is referenced by the Darwin bean and accordingly implements the interface Mortality. For details on the constructor args and properties, see the API documentation for Mortality_Reaper. The constructor used here is is the simplest one and simply takes the Random bean as a constructor argument.

        <bean id="Mortality" class="com.rubecula.darwin.domain.genetics.Mortality_Reaper">
            <constructor-arg>
                <ref bean="Random" />
            </constructor-arg>
        </bean>

The Fecundity bean determines how the number of progeny for a given mating is determined. This bean is referenced by the Darwin bean and accordingly implements the interface Fecundity. The standard class, Fecundity_Saturated, determines the number of progeny based on the current population saturation. For details on the constructor args and properties, see the API documentation for Fecundity_Saturated.

        <bean id="Fecundity"
            class="com.rubecula.darwin.domain.genetics.Fecundity_Saturated">
        </bean>

The Meiosis bean determines which genes (from the two parents) go into a progeny's genotype. This bean is referenced by the Genomic bean and accordingly implements the interface Meiosis. The standard class for Meiosis is Meiosis_Locus which chooses the alleles for the progeny's genotype bases purely by random. For details on the constructor args and properties, see the API documentation for Meiosis_Locus.

        <bean id="Meiosis" class="com.rubecula.darwin.domain.genetics.Meiosis_Locus">
            <constructor-arg>
                <ref bean="Random" />
            </constructor-arg>
        </bean>

The Mutator bean is responsible for any mutations that occur to the genotypes of the system. This bean is referenced by the Genomic bean and accordingly implements the interface Mutator. For this application it is constructed from the standard type Mutator_Random. For details on the constructor args and properties, see the API documentation for Mutator_Random.

        <bean id="Mutator" class="com.rubecula.darwin.domain.genetics.Mutator_Random">
            <constructor-arg>
                <ref bean="Random" />
            </constructor-arg>
        </bean>

The following bean is the first of the Allele definitions for this application. Each such bean is a member of the Locus bean and accordingly implements the interface Allele. For details on the constructor args and properties, see the API documentation for Allele_Dominance. As the name suggests, the AlleleDominant bean is the dominant allele for the pea genome locus in which we're interested.

        <bean id="AlleleDominant" class="com.rubecula.darwin.domain.genetics.Allele_Dominance">
            <constructor-arg>
                <value>B</value>
            </constructor-arg>
            <constructor-arg class="Boolean">
                <value>true</value>
            </constructor-arg>
            <member value="1" valueClass="Integer" membership="allele">!Locus
            </member>
        </bean>

As the name suggests, the AlleleRecessive bean is the recessive allele for the pea genome locus in which we're interested.

        <bean id="AlleleRecessive" class="com.rubecula.darwin.domain.genetics.Allele_Dominance">
            <constructor-arg>
                <value>b</value>
            </constructor-arg>
            <constructor-arg class="Boolean">
                <value>false</value>
            </constructor-arg>
            <member value="1" valueClass="Integer" membership="allele">!Locus
            </member>
        </bean>

The following bean represents the Locus of the genome in which we're interested for this application. This bean is a member of the ChromosomeNoSex bean and also an expresser of the Genomic bean and accordingly implements the interface Locus. For details on the constructor args and properties, see the API documentation for Locus_Triversian.

        <bean id="Locus" class="com.rubecula.darwin.domain.genetics.Locus_Triversian">
            <constructor-arg>
                <value>Flower</value>
            </constructor-arg>
            <constructor-arg>
                <ref bean="Random" />
            </constructor-arg>
            <member membership="locus">!ChromosomeNoSex</member>
        </bean>

The following bean is the first of the trait variant definitions for this application. This bean is a member of the Character bean and accordingly implements the interface Variant. For details on the constructor args and properties, see the API documentation for Variant_Numeric. As the name suggests, the VariantPurple bean is the variant which is seen as a purple flower.

        <bean id="VariantPurple" class="com.rubecula.darwin.domain.environment.Variant_Numeric">
            <constructor-arg>
                <value>purple</value>
            </constructor-arg>
            <constructor-arg class="Double">
                <value>0.4</value>
            </constructor-arg>
            <member membership="variant">!Character</member>
        </bean>

As the name suggests, the VariantWhite bean is the variant which is seen as a white flower.

        <bean id="VariantWhite" class="com.rubecula.darwin.domain.environment.Variant_Numeric">
            <constructor-arg>
                <value>white</value>
            </constructor-arg>
            <constructor-arg class="Double">
                <value>0.8</value>
            </constructor-arg>
            <member membership="variant">!Character</member>
        </bean>

The following bean represents the non-sexual Chromosome for the genome of this application. This bean is a member of the Genomic bean and accordingly implements the interface Chromosome. For details on the constructor args and properties, see the API documentation for Chromosome_NoSex

        <bean id="ChromosomeNoSex" class="com.rubecula.darwin.domain.genetics.Chromosome_NoSex">
            <constructor-arg>
                <value>No Sex Chromosome</value>
            </constructor-arg>
            <member membership="chromosome">!Genomic</member>
        </bean>

The following bean represents the genome for this application. This bean is referenced by the Darwin bean and accordingly implements the interface Genomic. For details on the constructor args and properties, see the API documentation for Genomic_Sexual. Note that it is not necessary to specifiy a sex chromosome for this genomic bean because it is provided out of the box.

        <bean id="Genomic" class="com.rubecula.darwin.domain.world.Genomic_Sexual">
            <constructor-arg>
                <value>Pea Plant</value>
            </constructor-arg>
            <constructor-arg>
                <ref bean="Meiosis" />
            </constructor-arg>
            <constructor-arg>
                <ref bean="Mutator" />
            </constructor-arg>
            <constructor-arg>
                <ref bean="Random" />
            </constructor-arg>
        </bean>

The following bean represents the genome for this application. This bean is referenced by the EcoFactor bean and accordingly implements the interface Fitness. For details on the constructor args and properties, see the API documentation for Fitness_Hamiltonian.

        <bean id="Fitness" class="com.rubecula.darwin.domain.fitness.Fitness_Hamiltonian">
            <member key="pea" membership="fitness">!FitnessEngine</member>
        </bean>

The following bean represents the fitness engine for the pea phenome. This bean is referenced by the Phenome and Fitness beans and accordingly implements the interface FitnessEngine. For details on the constructor args and properties, see the API documentation for FitnessEngine_Simple.

        <bean id="FitnessEngine"
            class="com.rubecula.darwin.domain.fitness.FitnessEngine_Simple">
        </bean>

The following bean represents the phenotypic character for the peas (the color of the flowers). This bean is a member of the Phenome and refernced by the Variant and Expresser beans and accordingly implements the interface Pharacter. For details on the constructor args and properties, see the API documentation for Pharacter_Fisherian.

        <bean id="Character"
            class="com.rubecula.darwin.domain.environment.Pharacter_Fisherian">
            <constructor-arg>
                <value>Flower Color</value>
            </constructor-arg>
            <member membership="character">!Phenome</member>
        </bean>

The following bean represents the gene expresser for this peas. This bean is referenced by the Locus bean and accordingly implements the interface Expresser. For details on the constructor args and properties, see the API documentation for Expresser_Mendelian.

        <bean id="Expresser" class="com.rubecula.darwin.domain.world.Expresser_Mendelian">
            <constructor-arg>
                <ref bean="Character" />
            </constructor-arg>
            <constructor-arg>
                <value>B</value>
            </constructor-arg>
            <constructor-arg>
                <value>purple</value>
            </constructor-arg>
            <member key="!Locus" keyClass="com.rubecula.darwin.domain.helper.Locus"
                membership="expresser">!Genomic</member>
        </bean>

The following bean represents the phenome for this peas. This bean is referenced by the Darwin bean and accordingly implements the interface Phenome. For details on the constructor args and properties, see the API documentation for Phenome_Gouldian.

        <bean id="Phenome"
            class="com.rubecula.darwin.domain.environment.Phenome_Gouldian">
            <constructor-arg>
                <ref bean="FitnessEngine" />
            </constructor-arg>
        </bean>

The following bean represents the evolving taxon for this application (the pea plant). This bean is referenced by the Evolution and Population beans and accordingly implements the interface Taxon. For details on the constructor args and properties, see the API documentation for Taxon_Darwinian.

        <bean id="Pea" class="com.rubecula.darwin.domain.world.Taxon_Darwinian">
            <constructor-arg>
                <value>Pisum sativum</value>
            </constructor-arg>
            <constructor-arg>
                <ref bean="Realm" />
            </constructor-arg>
            <constructor-arg>
                <ref bean="Genomic" />
            </constructor-arg>
            <constructor-arg>
                <ref bean="Phenome" />
            </constructor-arg>
            <constructor-arg>
                <ref bean="CensusTaker" />
            </constructor-arg>
            <constructor-arg>
                <ref bean="Mortality" />
            </constructor-arg>
            <constructor-arg>
                <ref bean="MateChoice" />
            </constructor-arg>
            <constructor-arg>
                <ref bean="Fecundity" />
            </constructor-arg>
            <property name="maxGenerations">
                <value>10</value>
            </property>
            <member value="1" valueClass="Integer" membership="evolvable">!Evolution
            </member>
        </bean>

The following bean represents the ecosystem factor for the evolution of peas (i.e. the shadiness). This bean is a member of Environment and Fitness beans and accordingly implements the interface EcoFactor. For details on the constructor args and properties, see the API documentation for EcoFactor_Humboldtian.

        <bean id="EcoFactor"
            class="com.rubecula.darwin.domain.environment.EcoFactor_Humboldtian">
            <constructor-arg>
                <value>shadiness</value>
            </constructor-arg>
            <property name="value" class="Double">
                <value>0.65</value>
            </property>
            <member membership="factor">!Environment</member>
            <member key="Flower Color" membership="weighting">!Fitness</member>
        </bean>

The following bean represents the environment in which the population of peas thrives. This bean is referenced and the Colony and EnvironmentListener beans and accordingly implements the interface Environment. For details on the constructor args and properties, see the API documentation for Environment_Muirian.

        <bean id="Environment" classclass="com.rubecula.darwin.domain.world.Environment_Muirian">
            <constructor-arg>
                <value>In a Monastery Garden</value>
            </constructor-arg>
            <constructor-arg>
                <ref bean="Realm" />
            </constructor-arg>
        </bean>

The following bean represents the (single) population of peas. This bean is a member of the Darwin bean and referenced by the Colony bean, and accordingly implements the interface Population. For details on the constructor args and properties, see the API documentation for Population_Malthusian. Note that it is not necessary to specifiy a sex chromosome for this genomic bean because it is provided out of the box.

        <bean id="Population" class="com.rubecula.darwin.domain.world.Population_Malthusian">
            <constructor-arg>
                <value>peas</value>
            </constructor-arg>
            <member membership="population">!Pea</member>
        </bean>

The following bean represents the single colony for the above population. This bean is a colony member by the Population bean and accordingly implements the interface Colony. For details on the constructor args and properties, see the API documentation for Colony_Mayrian.

        <bean id="Colony" class="com.rubecula.darwin.domain.world.Colony_Mayrian">
            <constructor-arg>
                <value>control colony</value>
            </constructor-arg>
            <constructor-arg>
                <ref bean="Environment" />
            </constructor-arg>
            <constructor-arg>
                <ref bean="Random" />
            </constructor-arg>
            <member membership="colony">!Population</member>
        </bean>

The following bean represents the environment listener for this environment defined above. This bean is a listener of the Environment bean and accordingly implements the interface EnvironmentListener. For details on the constructor args and properties, see the API documentation for EnvironmentListener_Writer.

        <bean id="EnvironmentListener"
            class="com.rubecula.darwin.domain.environment.EnvironmentListener_Writer">
            <constructor-arg>
                <ref bean="_Writer_" />
            </constructor-arg>
            <member membership="listener">!Environment</member>
        </bean>

Closing tags...

    </beans>
</configuration>