Mercurial > hg > de.mpg.mpiwg.itgroup.digilib.core
view libs/commons-math-2.1/docs/apidocs/org/apache/commons/math/genetics/RandomKey.html @ 32:d7a43156a79b default tip
new tabs
author | dwinter |
---|---|
date | Mon, 10 Oct 2011 17:52:22 +0200 |
parents | 878723cc40fb |
children |
line wrap: on
line source
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_17) on Sat Mar 27 22:46:12 EDT 2010 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> RandomKey (Commons Math 2.1 API) </TITLE> <META NAME="date" CONTENT="2010-03-27"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="RandomKey (Commons Math 2.1 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/RandomKey.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../org/apache/commons/math/genetics/Population.html" title="interface in org.apache.commons.math.genetics"><B>PREV CLASS</B></A> <A HREF="../../../../../org/apache/commons/math/genetics/RandomKeyMutation.html" title="class in org.apache.commons.math.genetics"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/commons/math/genetics/RandomKey.html" target="_top"><B>FRAMES</B></A> <A HREF="RandomKey.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.apache.commons.math.genetics</FONT> <BR> Class RandomKey<T></H2> <PRE> <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/commons/math/genetics/Chromosome.html" title="class in org.apache.commons.math.genetics">org.apache.commons.math.genetics.Chromosome</A> <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/commons/math/genetics/AbstractListChromosome.html" title="class in org.apache.commons.math.genetics">org.apache.commons.math.genetics.AbstractListChromosome</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>> <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.math.genetics.RandomKey<T></B> </PRE> <DL> <DT><DT><B>Type Parameters:</B><DD><CODE>T</CODE> - type of the permuted objects</DL> <DL> <DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A><<A HREF="../../../../../org/apache/commons/math/genetics/Chromosome.html" title="class in org.apache.commons.math.genetics">Chromosome</A>>, <A HREF="../../../../../org/apache/commons/math/genetics/Fitness.html" title="interface in org.apache.commons.math.genetics">Fitness</A>, <A HREF="../../../../../org/apache/commons/math/genetics/PermutationChromosome.html" title="interface in org.apache.commons.math.genetics">PermutationChromosome</A><T></DD> </DL> <HR> <DL> <DT><PRE>public abstract class <A HREF="../../../../../src-html/org/apache/commons/math/genetics/RandomKey.html#line.64"><B>RandomKey<T></B></A><DT>extends <A HREF="../../../../../org/apache/commons/math/genetics/AbstractListChromosome.html" title="class in org.apache.commons.math.genetics">AbstractListChromosome</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>><DT>implements <A HREF="../../../../../org/apache/commons/math/genetics/PermutationChromosome.html" title="interface in org.apache.commons.math.genetics">PermutationChromosome</A><T></DL> </PRE> <P> <p> Random Key chromosome is used for permutation representation. It is a vector of a fixed length of real numbers in [0,1] interval. The index of the i-th smallest value in the vector represents an i-th member of the permutation. </p> <p> For example, the random key [0.2, 0.3, 0.8, 0.1] corresponds to the permutation of indices (3,0,1,2). If the original (unpermuted) sequence would be (a,b,c,d), this would mean the sequence (d,a,b,c). </p> <p> With this representation, common operators like n-point crossover can be used, because any such chromosome represents a valid permutation. </p> <p> Since the chromosome (and thus its arrayRepresentation) is immutable, the array representation is sorted only once in the constructor. </p> <p> For details, see: <ul> <li>Bean, J.C.: Genetic algorithms and random keys for sequencing and optimization. ORSA Journal on Computing 6 (1994) 154â160</li> <li>Rothlauf, F.: Representations for Genetic and Evolutionary Algorithms. Volume 104 of Studies in Fuzziness and Soft Computing. Physica-Verlag, Heidelberg (2002)</li> </ul> </p> <P> <P> <DL> <DT><B>Since:</B></DT> <DD>2.0</DD> <DT><B>Version:</B></DT> <DD>$Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $</DD> </DL> <HR> <P> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/RandomKey.html#RandomKey(java.lang.Double[])">RandomKey</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>[] representation)</CODE> <BR> Constructor.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/RandomKey.html#RandomKey(java.util.List)">RandomKey</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>> representation)</CODE> <BR> Constructor.</TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/RandomKey.html#checkValidity(java.util.List)">checkValidity</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>> chromosomeRepresentation)</CODE> <BR> Asserts that <code>representation</code> can represent a valid chromosome.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> <TR ALIGN="right" VALIGN=""> <TD NOWRAP><FONT SIZE="-1"> <CODE><S> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>></CODE></FONT></TD> </TR> </TABLE> </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/RandomKey.html#comparatorPermutation(java.util.List, java.util.Comparator)">comparatorPermutation</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><S> data, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A><S> comparator)</CODE> <BR> Generates a representation of a permutation corresponding to the <code>data</code> sorted by <code>comparator</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../../org/apache/commons/math/genetics/RandomKey.html" title="type parameter in RandomKey">T</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/RandomKey.html#decode(java.util.List)">decode</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../../org/apache/commons/math/genetics/RandomKey.html" title="type parameter in RandomKey">T</A>> sequence)</CODE> <BR> Permutes the <code>sequence</code> of objects of type T according to the permutation this chromosome represents.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/RandomKey.html#identityPermutation(int)">identityPermutation</A></B>(int l)</CODE> <BR> Generates a representation corresponding to an identity permutation of length l which can be passed to the RandomKey constructor.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> <TR ALIGN="right" VALIGN=""> <TD NOWRAP><FONT SIZE="-1"> <CODE><S> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>></CODE></FONT></TD> </TR> </TABLE> </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/RandomKey.html#inducedPermutation(java.util.List, java.util.List)">inducedPermutation</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><S> originalData, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><S> permutedData)</CODE> <BR> Generates a representation of a permutation corresponding to a permutation which yields <code>permutedData</code> when applied to <code>originalData</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/RandomKey.html#isSame(org.apache.commons.math.genetics.Chromosome)">isSame</A></B>(<A HREF="../../../../../org/apache/commons/math/genetics/Chromosome.html" title="class in org.apache.commons.math.genetics">Chromosome</A> another)</CODE> <BR> Returns <code>true</code> iff <code>another</code> is a RandomKey and encodes the same permutation.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/RandomKey.html#randomPermutation(int)">randomPermutation</A></B>(int l)</CODE> <BR> Generates a representation corresponding to a random permutation of length l which can be passed to the RandomKey constructor.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/math/genetics/RandomKey.html#toString()">toString</A></B>()</CODE> <BR> </TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_org.apache.commons.math.genetics.AbstractListChromosome"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class org.apache.commons.math.genetics.<A HREF="../../../../../org/apache/commons/math/genetics/AbstractListChromosome.html" title="class in org.apache.commons.math.genetics">AbstractListChromosome</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/apache/commons/math/genetics/AbstractListChromosome.html#getLength()">getLength</A>, <A HREF="../../../../../org/apache/commons/math/genetics/AbstractListChromosome.html#getRepresentation()">getRepresentation</A>, <A HREF="../../../../../org/apache/commons/math/genetics/AbstractListChromosome.html#newFixedLengthChromosome(java.util.List)">newFixedLengthChromosome</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_org.apache.commons.math.genetics.Chromosome"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class org.apache.commons.math.genetics.<A HREF="../../../../../org/apache/commons/math/genetics/Chromosome.html" title="class in org.apache.commons.math.genetics">Chromosome</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/apache/commons/math/genetics/Chromosome.html#compareTo(org.apache.commons.math.genetics.Chromosome)">compareTo</A>, <A HREF="../../../../../org/apache/commons/math/genetics/Chromosome.html#findSameChromosome(org.apache.commons.math.genetics.Population)">findSameChromosome</A>, <A HREF="../../../../../org/apache/commons/math/genetics/Chromosome.html#getFitness()">getFitness</A>, <A HREF="../../../../../org/apache/commons/math/genetics/Chromosome.html#searchForFitnessUpdate(org.apache.commons.math.genetics.Population)">searchForFitnessUpdate</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_org.apache.commons.math.genetics.Fitness"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from interface org.apache.commons.math.genetics.<A HREF="../../../../../org/apache/commons/math/genetics/Fitness.html" title="interface in org.apache.commons.math.genetics">Fitness</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/apache/commons/math/genetics/Fitness.html#fitness()">fitness</A></CODE></TD> </TR> </TABLE> <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="RandomKey(java.util.List)"><!-- --></A><H3> RandomKey</H3> <PRE> public <A HREF="../../../../../src-html/org/apache/commons/math/genetics/RandomKey.html#line.81"><B>RandomKey</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>> representation)</PRE> <DL> <DD>Constructor. <P> <DL> <DT><B>Parameters:</B><DD><CODE>representation</CODE> - list of [0,1] values representing the permutation</DL> </DL> <HR> <A NAME="RandomKey(java.lang.Double[])"><!-- --></A><H3> RandomKey</H3> <PRE> public <A HREF="../../../../../src-html/org/apache/commons/math/genetics/RandomKey.html#line.98"><B>RandomKey</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>[] representation)</PRE> <DL> <DD>Constructor. <P> <DL> <DT><B>Parameters:</B><DD><CODE>representation</CODE> - array of [0,1] values representing the permutation</DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="decode(java.util.List)"><!-- --></A><H3> decode</H3> <PRE> public <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../../org/apache/commons/math/genetics/RandomKey.html" title="type parameter in RandomKey">T</A>> <A HREF="../../../../../src-html/org/apache/commons/math/genetics/RandomKey.html#line.105"><B>decode</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../../org/apache/commons/math/genetics/RandomKey.html" title="type parameter in RandomKey">T</A>> sequence)</PRE> <DL> <DD>Permutes the <code>sequence</code> of objects of type T according to the permutation this chromosome represents. For example, if this chromosome represents a permutation (3,0,1,2), and the unpermuted sequence is (a,b,c,d), this yields (d,a,b,c). <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math/genetics/PermutationChromosome.html#decode(java.util.List)">decode</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math/genetics/PermutationChromosome.html" title="interface in org.apache.commons.math.genetics">PermutationChromosome</A><<A HREF="../../../../../org/apache/commons/math/genetics/RandomKey.html" title="type parameter in RandomKey">T</A>></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>sequence</CODE> - the unpermuted (original) sequence of objects <DT><B>Returns:</B><DD>permutation of <code>sequence</code> represented by this permutation</DL> </DD> </DL> <HR> <A NAME="isSame(org.apache.commons.math.genetics.Chromosome)"><!-- --></A><H3> isSame</H3> <PRE> protected boolean <A HREF="../../../../../src-html/org/apache/commons/math/genetics/RandomKey.html#line.149"><B>isSame</B></A>(<A HREF="../../../../../org/apache/commons/math/genetics/Chromosome.html" title="class in org.apache.commons.math.genetics">Chromosome</A> another)</PRE> <DL> <DD>Returns <code>true</code> iff <code>another</code> is a RandomKey and encodes the same permutation. <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math/genetics/Chromosome.html#isSame(org.apache.commons.math.genetics.Chromosome)">isSame</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/math/genetics/Chromosome.html" title="class in org.apache.commons.math.genetics">Chromosome</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>another</CODE> - chromosome to compare <DT><B>Returns:</B><DD>true iff chromosomes encode the same permutation</DL> </DD> </DL> <HR> <A NAME="checkValidity(java.util.List)"><!-- --></A><H3> checkValidity</H3> <PRE> protected void <A HREF="../../../../../src-html/org/apache/commons/math/genetics/RandomKey.html#line.175"><B>checkValidity</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>> chromosomeRepresentation) throws <A HREF="../../../../../org/apache/commons/math/genetics/InvalidRepresentationException.html" title="class in org.apache.commons.math.genetics">InvalidRepresentationException</A></PRE> <DL> <DD>Asserts that <code>representation</code> can represent a valid chromosome. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math/genetics/AbstractListChromosome.html#checkValidity(java.util.List)">checkValidity</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/math/genetics/AbstractListChromosome.html" title="class in org.apache.commons.math.genetics">AbstractListChromosome</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>chromosomeRepresentation</CODE> - representation of the chromosome <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../../org/apache/commons/math/genetics/InvalidRepresentationException.html" title="class in org.apache.commons.math.genetics">InvalidRepresentationException</A></CODE> - iff the <code>representation</code> can not represent a valid chromosome</DL> </DD> </DL> <HR> <A NAME="randomPermutation(int)"><!-- --></A><H3> randomPermutation</H3> <PRE> public static final <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>> <A HREF="../../../../../src-html/org/apache/commons/math/genetics/RandomKey.html#line.192"><B>randomPermutation</B></A>(int l)</PRE> <DL> <DD>Generates a representation corresponding to a random permutation of length l which can be passed to the RandomKey constructor. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>l</CODE> - length of the permutation <DT><B>Returns:</B><DD>representation of a random permutation</DL> </DD> </DL> <HR> <A NAME="identityPermutation(int)"><!-- --></A><H3> identityPermutation</H3> <PRE> public static final <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>> <A HREF="../../../../../src-html/org/apache/commons/math/genetics/RandomKey.html#line.208"><B>identityPermutation</B></A>(int l)</PRE> <DL> <DD>Generates a representation corresponding to an identity permutation of length l which can be passed to the RandomKey constructor. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>l</CODE> - length of the permutation <DT><B>Returns:</B><DD>representation of an identity permutation</DL> </DD> </DL> <HR> <A NAME="comparatorPermutation(java.util.List, java.util.Comparator)"><!-- --></A><H3> comparatorPermutation</H3> <PRE> public static <S> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>> <A HREF="../../../../../src-html/org/apache/commons/math/genetics/RandomKey.html#line.229"><B>comparatorPermutation</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><S> data, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A><S> comparator)</PRE> <DL> <DD>Generates a representation of a permutation corresponding to the <code>data</code> sorted by <code>comparator</code>. The <code>data</code> is not modified during the process. This is useful if you want to inject some permutations to the initial population. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Type Parameters:</B><DD><CODE>S</CODE> - type of the data<DT><B>Parameters:</B><DD><CODE>data</CODE> - list of data determining the order<DD><CODE>comparator</CODE> - how the data will be compared <DT><B>Returns:</B><DD>list representation of the permutation corresponding to the parameters</DL> </DD> </DL> <HR> <A NAME="inducedPermutation(java.util.List, java.util.List)"><!-- --></A><H3> inducedPermutation</H3> <PRE> public static <S> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>> <A HREF="../../../../../src-html/org/apache/commons/math/genetics/RandomKey.html#line.249"><B>inducedPermutation</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><S> originalData, <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><S> permutedData) throws <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></PRE> <DL> <DD>Generates a representation of a permutation corresponding to a permutation which yields <code>permutedData</code> when applied to <code>originalData</code>. This method can be viewed as an inverse to <A HREF="../../../../../org/apache/commons/math/genetics/RandomKey.html#decode(java.util.List)"><CODE>decode(List)</CODE></A>. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Type Parameters:</B><DD><CODE>S</CODE> - type of the data<DT><B>Parameters:</B><DD><CODE>originalData</CODE> - the original, unpermuted data<DD><CODE>permutedData</CODE> - the data, somehow permuted <DT><B>Returns:</B><DD>representation of a permutation corresponding to the permutation <code>originalData -> permutedData</code> <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - iff the <code>permutedData</code> and <code>originalData</code> contains different data</DL> </DD> </DL> <HR> <A NAME="toString()"><!-- --></A><H3> toString</H3> <PRE> public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/commons/math/genetics/RandomKey.html#line.273"><B>toString</B></A>()</PRE> <DL> <DD> <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math/genetics/AbstractListChromosome.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/math/genetics/AbstractListChromosome.html" title="class in org.apache.commons.math.genetics">AbstractListChromosome</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</A>></CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/RandomKey.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../org/apache/commons/math/genetics/Population.html" title="interface in org.apache.commons.math.genetics"><B>PREV CLASS</B></A> <A HREF="../../../../../org/apache/commons/math/genetics/RandomKeyMutation.html" title="class in org.apache.commons.math.genetics"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/commons/math/genetics/RandomKey.html" target="_top"><B>FRAMES</B></A> <A HREF="RandomKey.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright © 2003-2010 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved. </BODY> </HTML>