com.rubecula.darwin.examples.travelingsalesman
Class Expresser_TS
java.lang.Object
com.rubecula.darwin.domain.environment.Expresser_
com.rubecula.darwin.examples.travelingsalesman.Expresser_TS
- All Implemented Interfaces:
- Expresser
public final class Expresser_TS
- extends Expresser_
- Author:
- Robin Hillyard
Method Summary |
java.util.Collection<Expression> |
express(Colony colony,
Gene... genes)
TODO this is apparently called more often than necessary |
Trait |
express(Gene... genes)
Express the genes. |
java.lang.String |
getComplement(Locus locus,
java.lang.String allele)
In this implementation, if the locus is a swap, then we simply return the
allele passed in because two identical swaps are complementary. |
boolean |
isComplementary(Locus locus,
java.lang.String allele1,
java.lang.String allele2)
In this implementation of isComplementary, there are two situations: swap
or rotate. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Expresser_TS
public Expresser_TS(Pharacter character)
- Parameters:
character
-
express
public java.util.Collection<Expression> express(Colony colony,
Gene... genes)
- TODO this is apparently called more often than necessary
- Specified by:
express
in interface Expresser
- Overrides:
express
in class Expresser_
- Parameters:
colony
- (which may be null)genes
- one gene or a set of polygenic genes.
- Returns:
- a collection of objects which are either a
Trait
or an
ExPhen
- See Also:
Expresser_.express(com.rubecula.darwin.domain.helper.Colony,
com.rubecula.darwin.domain.helper.Gene[])
express
public Trait express(Gene... genes)
- Description copied from interface:
Expresser
- Express the genes.
- Returns:
- a
Trait
- See Also:
Expresser.express(com.rubecula.darwin.domain.helper.Gene[])
getComplement
public java.lang.String getComplement(Locus locus,
java.lang.String allele)
- In this implementation, if the locus is a swap, then we simply return the
allele passed in because two identical swaps are complementary.
Otherwise, we invoke the super-method.
- Specified by:
getComplement
in interface Expresser
- Overrides:
getComplement
in class Expresser_
- Returns:
- the complementary allele key.
- See Also:
Expresser_.getComplement(com.rubecula.darwin.domain.helper.Locus,
java.lang.String)
isComplementary
public boolean isComplementary(Locus locus,
java.lang.String allele1,
java.lang.String allele2)
- In this implementation of isComplementary, there are two situations: swap
or rotate. Two adjacent swaps are complementary if the alleles are equal.
Two adjacent rotations are complementary if the sum of the number of
places rotated is zero.
- Specified by:
isComplementary
in interface Expresser
- Overrides:
isComplementary
in class Expresser_
- Returns:
- true if the alleles are complementary, i.e. if expressed
sequentially, the result would be the same as if they had not
been expressed at all.
- See Also:
Expresser_.isComplementary(com.rubecula.darwin.domain.helper.Locus,
java.lang.String, java.lang.String)
Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.