com.rubecula.darwin.core
Interface Locus

All Known Implementing Classes:
Locus_Abstract, Locus_Default, Locus_PepperedMoth, Locus_TS

public interface Locus

Defines a Locus at which one of several Alleles may appear. The set of possible alleles is backed by a HashSet so that ordering is not important.
Currently, all alleles are equally likely to occur in a seed population.

TODO Allow probabilities to be specified for the seeding of each allele.

Version:
$Revision: 1.1 $
Author:
Robin Hillyard

Method Summary
 void add(Allele allele)
          Method to add an allele to this locus.
 void add(Allele allele, int frequency)
          Method to add an allele to this locus.
 boolean isLegal(Allele allele)
          Method to determine if this Locus may contain allele with a non-zero frequency
 Allele pickAllele()
          Method to randomly pick an allele from the set of possible alleles, and chosen according to the frequencies specified for each allele.
 

Method Detail

add

void add(Allele allele)
Method to add an allele to this locus.

Parameters:
allele - An allele which can possibly appear at this locus.

add

void add(Allele allele,
         int frequency)
Method to add an allele to this locus.

Parameters:
allele - An allele which can possibly appear at this locus.

isLegal

boolean isLegal(Allele allele)
Method to determine if this Locus may contain allele with a non-zero frequency

Parameters:
allele -
Returns:
true if locus contains allele and frequency is greater than 0

pickAllele

Allele pickAllele()
Method to randomly pick an allele from the set of possible alleles, and chosen according to the frequencies specified for each allele.

Returns:
a randomly chosen legal allele for this locus.