亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? strictpermutation.java

?? 遺傳算法源代碼,實現(xiàn)了選擇操作、交叉操作和變異操作
?? JAVA
字號:
/*--- formatted by Jindent 2.1, (www.c-lab.de/~jindent) ---*//** * StrictPermutation *  * location: net.openai.ai.ga.cell.encoding.StrictPermutation *  */package net.openai.ai.ga.cell.encoding;/** * The <code>StrictPermutation</code> class stores a permutation of values from * 0 to (length-1). All values are represented, however it is their order * that is of interest. This class supports cross-over and mutation. *  * the maximum for the list in * @author	Jared Grubb * @version	%I%, %G% * @since	JDK1.3 */public class StrictPermutation {    /**     * The list of values     */    private int[]  valList;    /**     * The name of this permutation     */    private String name;    /**     * Creates a new <code>StrictPermutation</code> with the specified length     * and given name.     *      * @param name	a <code>String</code> representing the string's name     * @param length	the number of elements in this list     */    public StrictPermutation(String name, int length) {	setLength(length);	setListLoosely(null);    }    /**     * Creates a new <code>StrictPermutation</code> initialized with the     * specified capacity and starting with the values in the passed integer     * array so far as is possible using <code>setListLoosely</code>.     *      * @param name	a <code>String</code> representing the string's name     * @param capacity	the number of elements in this list     * @param value	the initial value for the binary string     */    public StrictPermutation(String name, int length, int[] vals) {	setLength(length);	setListLoosely(vals);    }    /**     * Creates and returns a clone of the given <code>StrictPermutation</code>.     * Throws <code>NullPointerException</code> when passed <code>null</code>.     *      * @param toClone	the binary string to clone     */    public StrictPermutation(StrictPermutation toClone) {	this(toClone.getName(), toClone.getLength(), toClone.getList());    }    /**     * Returns the length of this permutation list     *      * @returns the length of the permutation     */    public int getLength() {	return this.valList.length;    }     /**     * Sets the length of this permutation. Destroys any previous list and     * initializes a new one.     *      * @param length	the length of the permutation     */    public void setLength(int size) {	if (size < 0) {	    // Throw exception	} 	this.valList = new int[size];	for (int i = 0; i < size; i++) {	    this.valList[i] = i;	}    }     /**     * Returns the name of this permutation list     *      * @returns a <code>String</code> of the name of this permutation     */    public String getName() {	return this.name;    }     /**     * Sets the name of this permutation     *      * @param name	the <code>String</code> for the new name of this list     */    public void setName(String name) {	this.name = name;    }     /**     * Returns this permutation as a <code>int[]</code>.     *      * @returns a <code>int[]</code> of this permutation     */    public int[] getList() {	return this.valList;    }     /**     * Sets the permutation to the values in the given list.     *      * @param list 	an <code>int[]</code> value to duplicate     */    public void setList(int[] list) {	if (list.length != this.valList.length) {	    // Throw exception	    return;	} 	boolean[] check = new boolean[this.valList.length];	for (int i = 0; i < this.valList.length; i++) {	    check[i] = false;	}	for (int i = 0; i < this.valList.length; i++) {	    if (check[list[i]] == true) {		// Throw exception??		return;	    } 	    this.valList[i] = list[i];	    check[list[i]] = true;	}     }     /**     * Sets the permutation to the values in the given list when possible.     * Calls setListLoosely(list, 0);     *      * @param list 	an <code>int[]</code> value to try to duplicate     */    public void setListLoosely(int[] list) {	setListLoosely(list, 0);    }     /**     * Sets the permutation to the values in the given list when possible     * starting from a given position. All elements before this position are     * left alone. If a duplicate is found, it is skipped and not added a     * second time. If not all values have been added into the list, then they     * are added sequentially to fill the list. When (start<0) or (start>length)     * an exception is thrown.     *      * @param list 	an <code>int[]</code> value to try to duplicate     * @param start the position to start from     */    public void setListLoosely(int[] list, int start) {	if (start < 0 || start > this.valList.length) {	    // Throw exception	    return;	} 	boolean[] check = new boolean[this.valList.length];	for (int i = 0; i < this.valList.length; i++) {	    check[i] = false;	}	for (int i = 0; i < start; i++) {	    check[this.valList[i]] = true;	}	// Try to copy this list	int j = start;	if (list != null) {	    for (int i = 0; i < list.length; i++) {		// Make sure it's a good value first		if (list[i] < 0 || list[i] >= this.valList.length) {		    continue;		    // Add it if not already done		} 		if (check[list[i]] == false) {		    this.valList[j++] = list[i];		    check[list[i]] = true;		    if (j > this.valList.length) {			break;		    } 		} 	    } 	} 	int i = 0;    // Add all the rest of the numbers	for (; j < this.valList.length; j++) {	    while (check[i] == true) {		i++;	    }	    this.valList[j] = i;	    check[i] = true;	}     }     /**     * Returns the value of a certain element in the permutation     *      * @param element	the element to return     * @returns	the value of the permutation at this point     */    public int getElement(int element) {	if (element < 0 || element > this.valList.length) {	    // Throw exception	    return 0;	} 	return valList[element];    }     /**     * Returns a new <code>StrictPermutation</code> based on two other     * permutations of the same length. A cross-over point is picked at     * random and all elements before this point are the same as the first     * parent's and all all other elements are added in the same order as they     * are in the second permutation when possible. Neither parent is altered     * during this call.     *      * @param first	the first <code>StrictPermutation</code>     * @param second the second <code>StrictPermutation</code>     * @returns	a new <code>StrictPermutation</code>     */    public static StrictPermutation cross(StrictPermutation first, 					  StrictPermutation second) {	if (first.getLength() != second.getLength()) {	    // Throw exception	    return null;	} 	StrictPermutation n = new StrictPermutation(first);	int		  crossover_pt = 	    ((int) (Math.random() * (double) (first.getLength())));	n.setListLoosely(second.getList(), crossover_pt);	return n;    }     /**     * Mutates a given number of elements in the permutation. The mutation is     * the exchange of two elements in the list. A non-positive argument     * results in no change in the string.     *      * @param amount the number of elements to exchange ("mutate")     */    public void mutate(int amount) {	int f, s, temp;	for (int i = 0; i < amount; i++) {	    f = (int) ((Math.random() * (double) (this.getLength())));	    s = (int) ((Math.random() * (double) (this.getLength())));	    temp = this.valList[f];	    this.valList[f] = this.valList[s];	    this.valList[s] = temp;	}     }     /**     * Method declaration     *     *     * @return     *     * @see     */    public String toString() {	StringBuffer sb = new StringBuffer(String.valueOf(this.valList[0]));	for (int i = 1; i < this.valList.length; i++) {	    sb.append(" " + this.valList[i]);	}	return sb.toString();    } }/*--- formatting done in "Sun Java Convention" style on 12-28-2000 ---*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人国产一区二区三区精品| 日韩久久一区二区| 国产成人午夜片在线观看高清观看| 亚洲视频资源在线| 欧美久久高跟鞋激| 国产精品资源在线看| 久久久久久一二三区| 色婷婷av一区二区三区大白胸| 午夜精品一区在线观看| 欧美激情综合五月色丁香小说| 制服丝袜亚洲播放| 91在线你懂得| 国内久久精品视频| 日韩av一区二区三区| 亚洲三级在线观看| 久久久久九九视频| 色88888久久久久久影院野外| 国产精品一区专区| 免费高清在线一区| 亚洲综合无码一区二区| 国产精品国模大尺度视频| 日韩欧美激情四射| 欧美r级电影在线观看| 99精品久久99久久久久| 蜜臀91精品一区二区三区| 亚洲人精品一区| 久久亚洲影视婷婷| 精品国产伦一区二区三区观看方式| 91成人网在线| 成人午夜电影小说| 高清成人免费视频| 国产综合久久久久久鬼色 | 日韩一区二区高清| 97久久精品人人做人人爽| 国产激情一区二区三区| 韩国中文字幕2020精品| 天天综合色天天综合| 亚洲 欧美综合在线网络| 亚洲女女做受ⅹxx高潮| 国产精品不卡视频| 欧美国产97人人爽人人喊| 欧美v国产在线一区二区三区| 欧美日韩亚洲综合| 成人晚上爱看视频| a在线播放不卡| 风流少妇一区二区| 国产一区二区三区美女| 国产精一品亚洲二区在线视频| 久草热8精品视频在线观看| 三级成人在线视频| 日韩精品91亚洲二区在线观看| 日韩一区欧美二区| 日韩av电影一区| 蜜臀精品久久久久久蜜臀| 欧美aaa在线| 麻豆成人免费电影| 久久 天天综合| 精品亚洲国内自在自线福利| 狠狠色丁香久久婷婷综合丁香| 美女视频网站黄色亚洲| 捆绑变态av一区二区三区| 天天操天天干天天综合网| 亚洲大片一区二区三区| 久久精品国产秦先生| 蜜桃视频一区二区三区在线观看 | 亚洲欧洲日产国码二区| 中文字幕亚洲视频| 亚洲va欧美va人人爽午夜| 日韩av电影免费观看高清完整版| 五月天久久比比资源色| 悠悠色在线精品| 免费精品视频在线| 韩国av一区二区三区四区 | 亚洲国产精品影院| 亚洲欧洲国产日本综合| 日韩一区二区免费在线电影| 丁香桃色午夜亚洲一区二区三区| 成人国产精品视频| 国产69精品久久久久777| 国产高清精品在线| 蜜桃视频一区二区三区 | 一区二区三区中文免费| 一色屋精品亚洲香蕉网站| 久久青草欧美一区二区三区| 国产亚洲短视频| 国产欧美日韩精品a在线观看| 欧美一区二区在线看| 国产精品拍天天在线| 精品国产麻豆免费人成网站| 亚洲高清三级视频| 成人国产精品免费观看| 亚洲人吸女人奶水| 色偷偷一区二区三区| 欧美www视频| 欧美日韩国产一级| 一本色道**综合亚洲精品蜜桃冫| av电影天堂一区二区在线| 99在线精品观看| 久久精品无码一区二区三区| bt7086福利一区国产| 欧美性一区二区| 国产精品一区专区| 欧美日韩一级视频| 久久综合九色综合久久久精品综合 | 99久久777色| 欧美日韩国产精品自在自线| 久久只精品国产| 亚洲风情在线资源站| 国产传媒日韩欧美成人| 色综合久久中文综合久久97| 久久久精品免费网站| 亚洲成人三级小说| 成人美女视频在线观看| 欧美日韩精品三区| 亚洲欧洲精品一区二区三区不卡| 日本中文字幕一区二区视频| 97se亚洲国产综合在线| 久久久久久久久岛国免费| 午夜影院在线观看欧美| 成人av网站在线观看免费| 欧美日本一区二区在线观看| 欧美视频第二页| 国产亚洲精品超碰| 狠狠狠色丁香婷婷综合激情| 91精品国产综合久久福利| 亚洲国产精品久久久久婷婷884 | 日韩国产精品久久久久久亚洲| 一本高清dvd不卡在线观看| 国产精品高潮久久久久无| 成人免费看的视频| 国产亚洲1区2区3区| 国产成人8x视频一区二区| 久久亚洲春色中文字幕久久久| 久久se精品一区精品二区| 日韩亚洲欧美在线观看| 免费日韩伦理电影| 日韩精品影音先锋| 精品亚洲成a人| 久久久久久久性| 国产很黄免费观看久久| 国产农村妇女精品| 成人app软件下载大全免费| 国产精品初高中害羞小美女文| 99久久综合国产精品| 亚洲人成亚洲人成在线观看图片 | 亚洲在线中文字幕| 日本道精品一区二区三区| 亚洲一区二区三区中文字幕| 欧美日韩国产小视频| 琪琪久久久久日韩精品| 亚洲精品在线观| 丁香婷婷综合激情五月色| 亚洲色图丝袜美腿| 欧美日韩国产乱码电影| 久久精品久久99精品久久| 26uuu色噜噜精品一区二区| 国产成人日日夜夜| 亚洲人成在线播放网站岛国| 欧美日韩免费电影| 美女一区二区三区| 久久久久亚洲综合| 色婷婷久久一区二区三区麻豆| 亚洲国产视频一区| 日韩一卡二卡三卡国产欧美| 国产一区二三区| 亚洲老司机在线| 日韩一卡二卡三卡国产欧美| 懂色中文一区二区在线播放| 精品成人免费观看| 丁香啪啪综合成人亚洲小说| 精品一区二区在线视频| 日日噜噜夜夜狠狠视频欧美人| 国产精品久久久久婷婷二区次| 欧美亚洲国产bt| 精品视频免费看| 91久久一区二区| 92国产精品观看| 精品国产91亚洲一区二区三区婷婷| 国内精品第一页| 亚洲综合一二三区| 久久影院电视剧免费观看| 一本大道av伊人久久综合| 捆绑调教一区二区三区| √…a在线天堂一区| 日韩免费视频一区| 色av综合在线| 国产精品伊人色| 午夜不卡av在线| 国产三级精品三级| 欧美日韩国产综合一区二区三区| 国产美女视频一区| 亚洲成a人v欧美综合天堂下载| 国产视频不卡一区| 日韩视频一区在线观看| 99久久99久久精品国产片果冻 | 色综合咪咪久久| 激情综合色综合久久| 亚洲福利一区二区| 国产精品国产自产拍在线| 久久亚洲免费视频|