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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fixedbinarystring.java

?? 遺傳算法源代碼,實現了選擇操作、交叉操作和變異操作
?? JAVA
字號:
/*--- formatted by Jindent 2.1, (www.c-lab.de/~jindent) ---*//** * FixedBinaryString *  * location: net.openai.ai.ga.cell.encoding.FixedBinaryString *  */package net.openai.ai.ga.cell.encoding;/** * The <code>FixedBinaryString</code> is an encoding method using a string * of binary digits. The value is represented as a <code>long</code> and has * a fixed length in bits. It supports single cross-over and mutation. *  * @author	Jared Grubb * @version	%I%, %G% * @since	JDK1.3 */public class FixedBinaryString {    /**     * Every bit is a bit in a long. Therefore this string is limited to 64 bits     */    private long   bits;    /**     * The number of bits in the binary string     */    private int    size;    /**     * The mask to and bits with every time it is set     */    private long   mask;    /**     * The name of this binary string     */    private String name;    /**     * Creates a new <code>FixedBinaryString</code> with the specified bit-     * length and given name.     *      * @param name	a <code>String</code> representing the string's name     * @param size	the length of the binary string in bits     */    public FixedBinaryString(String name, int size) {	setName(name);	setSize(size);    }    /**     * Creates a new <code>FixedBinaryString</code> with the specified bit-length     * and initial value and given name.     *      * @param name	a <code>String</code> representing the string's name     * @param size	the length of the binary string in bits     * @param value	the initial value for the binary string     */    public FixedBinaryString(String name, int size, long value) {	setName(name);	setSize(size);	setLong(value);    }    /**     * Creates and returns a clone of the given <code>FixedBinaryString</code>.     * Throws <code>NullPointerException</code> when passed <code>null</code>.     *      * @param toClone	the binary string to clone     */    public FixedBinaryString(FixedBinaryString toClone) {	this(toClone.getName(), toClone.getSize(), toClone.getLong());    }    /**     * Returns the length of this binary string in bits     *      * @returns the length of the string in bits     */    public int getSize() {	return size;    }     /**     * Sets the length of this binary string in bits     *      * @param size	the length of the binary string in bits     */    public void setSize(int size) {	if (size < 0 || size > 64) {	    // Throw exception	} 	this.size = size;	// For example: size = 6:	// -1<<size = ...1111_1100_0000	// ~(-1<<size)= ...0000_0011_1111	this.mask = ~(-1L << size);    }     /**     * Returns the value of this binary string as a <code>long</code>.     *      * @returns a <code>long</code> value of this binary string     */    public long getLong() {	return bits;    }     /**     * Sets the binary string to the value as a <code>long</code>. Performs a     * bit-wise AND (&) to clear all bits above the length of this binary string.     *      * @param newVal	a <code>long</code> value to set this to     */    public void setLong(long newVal) {	bits = (newVal & this.mask);    }     /**     * Returns the bit-status of a certain bit in this binary string.     *      * @returns	<code>false</code> if the bit is 0;     * <code>true</code> if the bit is 1;     */    public boolean getBit(int bitNum) {	if (bitNum < 0 || bitNum > this.size) {	    // Throw exception	    return false;	} 	return (bits & (1L << bitNum)) != 0;    }     /**     * Sets a given bit in the binary string     *      * @param bitNum	sets the given bit to <code>true</code> ("1")     */    public void setBit(int bitNum) {	if (bitNum < 0 || bitNum > this.size) {	    // Throw exception	    return;	} 	this.bits &= ~(1L << bitNum);    }     /**     * Clears a given bit in the binary string     *      * @param bitNum	sets the given bit to <code>false</code> ("0")     */    public void clearBit(int bitNum) {	if (bitNum < 0 || bitNum > this.size) {	    // Throw exception	    return;	} 	this.bits |= (1L << bitNum);    }     /**     * Sets the name of this binary string to the given name     *      * @param name	a <code>String</code> for the new name     */    public void setName(String name) {	this.name = name;    }     /**     * Gets the name of this binary string     *      * @returns	a <code>String</code> of the name of this binary string     */    public String getName() {	return this.name;    }     /**     * Returns a <code>String</code> representation of this binary string as a     * string of binary digits. Leading zeroes are trimmed.     *      * @returns a <code>String</code> representation in binary     */    public String toBinaryString() {	return Long.toBinaryString(bits);    }     /**     * Returns a <code>String</code> representation of this binary string as a     * string of binary digits, including leading zeroes     *      * @returns a <code>String</code> representation in binary     */    public String toFullBinaryString() {	String full = this.toBinaryString();	for (int i = full.length(); i < this.size; i++) {	    full = "0" + full;	}	return full;    }     /**     * Returns a <code>String</code> representation of this binary string as a     * string of hex digits. Leading zeroes are trimmed.     *      * @returns a <code>String</code> representation in hexadecimal     */    public String toHexString() {	return Long.toHexString(bits);    }     /**     * Returns a <code>String</code> representation of this binary string as a     * string of hexadecimal digits, including leading zeroes     *      * @returns a <code>String</code> representation in hexadecimal     */    public String toFullHexString() {	String full = this.toHexString();	int    expSize = this.size / 4;	if (this.size % 4 != 0) {	    expSize++;	} 	for (int i = full.length(); i < expSize; i++) {	    full = "0" + full;	}	return full;    }     /**     * Returns a new <code>FixedBinaryString</code> based on two other     * binary strings of the same length. A cross-over point is picked at     * random and all bits before this point are the same as the first parent's     * and all bits after this point are the same as the second parent's.     * Neither parent is altered during this call.     *      * @returns	a new <code>FixedBinaryString</code>     */    public static FixedBinaryString cross(FixedBinaryString first, 					  FixedBinaryString second) {	if (first.getSize() != second.getSize()) {	    // Throw exception	    return null;	} 	FixedBinaryString n = new FixedBinaryString(first);	long		  crossover_pt = -1L 					 << ((long) (Math.random() 					 * (double) (first.getSize())));	n.setLong((first.getLong() & crossover_pt) 		  + (second.getLong() & ~crossover_pt));	return n;    }     /**     * Mutates a given number of bits in the binary string. The mutation is the     * inversion of the bit. A non-positive argument results in no change in the     * string.     *      * @param amount the number of bits to invert ("mutate")     */    public void mutate(int amount) {	for (int i = 0; i < amount; i++) {	    bits ^= 1L << ((long) (Math.random() * (double) (this.size)));	}     } }/*--- formatting done in "Sun Java Convention" style on 12-28-2000 ---*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成a人片综合在线| 精品一区二区日韩| 91在线精品一区二区三区| 国产色产综合色产在线视频| 亚洲精品一二三| 91一区二区三区在线播放| 国产亚洲综合在线| 精品一二线国产| 精品国产免费人成在线观看| 国产欧美精品一区二区三区四区| 亚洲成人动漫在线免费观看| 国产一区二区免费看| 成人av电影在线| 综合久久国产九一剧情麻豆| 97国产一区二区| 国产在线播放一区二区三区| 成人黄色电影在线| 精品福利av导航| 免费日韩伦理电影| 久久九九久久九九| 91网址在线看| 日韩中文字幕亚洲一区二区va在线| 欧美在线不卡视频| 亚洲国产日韩精品| 国产亚洲精品久| 亚洲成a人v欧美综合天堂| 欧美做爰猛烈大尺度电影无法无天| 亚洲综合在线五月| 精品国产91久久久久久久妲己 | 亚洲午夜久久久久久久久电影网 | 国产日韩v精品一区二区| 97精品国产露脸对白| 免费欧美高清视频| 亚洲欧美一区二区三区国产精品| 一本到高清视频免费精品| 一区二区三区欧美| 亚洲精品一区二区三区影院| 成av人片一区二区| 免费在线看成人av| 国产日韩av一区二区| 欧美一区二区三区思思人| eeuss影院一区二区三区| 久久疯狂做爰流白浆xx| 亚洲在线视频一区| 国产精品网站在线观看| 欧美色图免费看| 99国产精品久久久久久久久久 | 欧美乱熟臀69xxxxxx| 99re视频这里只有精品| 成人avav在线| 99国产精品久久久久久久久久久| 成人免费高清在线| 不卡的av中国片| 成人动漫一区二区| 粉嫩嫩av羞羞动漫久久久| 国产精品99久久久| 成人做爰69片免费看网站| 国产成人在线视频播放| 国产自产视频一区二区三区| 蜜臂av日日欢夜夜爽一区| 三级成人在线视频| 91日韩精品一区| 成人一区二区视频| 成人午夜免费视频| 色欧美片视频在线观看| 欧美久久久久免费| 欧美精品在线一区二区| 精品美女在线播放| 亚洲欧洲性图库| 亚洲国产你懂的| 免费一级片91| 丁香婷婷综合五月| 欧美精品一区二| 国产精品嫩草影院com| 亚洲国产精品99久久久久久久久| 国产精品美女久久久久久久久| 欧美一区二区视频在线观看| 欧美一区二区三区在线电影| 欧美一区午夜视频在线观看| 精品国产自在久精品国产| 久久综合网色—综合色88| 中文字幕人成不卡一区| 亚洲国产裸拍裸体视频在线观看乱了 | 亚洲国产成人va在线观看天堂| 日韩专区欧美专区| av一二三不卡影片| 日韩欧美国产综合| 亚洲视频一二区| 麻豆精品精品国产自在97香蕉| 99久久er热在这里只有精品15| 欧美精品v日韩精品v韩国精品v| 国产精品丝袜91| 日本成人在线网站| 97国产精品videossex| 日韩一级大片在线观看| 一区二区三区在线观看欧美| 国产精品亚洲专一区二区三区| 欧美曰成人黄网| 国产亚洲午夜高清国产拍精品| 亚洲国产综合在线| 成人av网站免费| 久久久久久黄色| 免费人成精品欧美精品| 91福利小视频| 国产精品久久久久影院| 奇米四色…亚洲| 欧美影视一区在线| 亚洲欧美影音先锋| 另类综合日韩欧美亚洲| 欧美日韩视频不卡| 亚洲欧美一区二区三区极速播放| 久久黄色级2电影| 欧美午夜电影网| 欧美国产精品v| 精品亚洲成av人在线观看| 色屁屁一区二区| 国产欧美精品一区二区色综合朱莉| 亚洲超碰97人人做人人爱| 99re热这里只有精品免费视频 | 久久久精品中文字幕麻豆发布| 丝袜诱惑亚洲看片| 在线视频国内自拍亚洲视频| 国产校园另类小说区| 免费观看成人av| 91精品久久久久久蜜臀| 亚洲电影第三页| 欧美性做爰猛烈叫床潮| 另类小说图片综合网| 欧美日韩在线三区| 另类小说欧美激情| 久久久久久久久岛国免费| 日本女优在线视频一区二区| 欧美日韩精品综合在线| 亚洲一区二区三区四区在线免费观看 | 国产自产高清不卡| 国产农村妇女精品| 国产91富婆露脸刺激对白| 亚洲欧美偷拍另类a∨色屁股| 色哟哟日韩精品| 亚洲成人av在线电影| 精品国产青草久久久久福利| 国产精品一区二区无线| 亚洲欧洲三级电影| 欧美一级专区免费大片| 色综合久久久久久久久| 久久国产精品色| 国产精品电影院| 日韩一区二区电影| 国产一区二区三区在线观看免费| 亚洲男人的天堂在线观看| 欧美性生活大片视频| 国产乱人伦偷精品视频不卡| 精品日韩在线观看| 国产黄色91视频| 亚洲一区二区精品3399| 亚洲在线中文字幕| 国产成人精品影视| 欧美日韩国产综合草草| 菠萝蜜视频在线观看一区| 日本一区二区在线不卡| 国产精品系列在线观看| 亚洲欧美另类久久久精品2019| 欧美性猛片xxxx免费看久爱| 亚洲综合在线电影| 91精品国产乱| 国产一区999| 欧美变态口味重另类| 高清日韩电视剧大全免费| 精品国产乱码久久久久久久久 | 一区二区三区中文字幕在线观看| 一本大道久久a久久综合婷婷 | 972aa.com艺术欧美| 狠狠色丁香久久婷婷综| 毛片一区二区三区| 91精品免费观看| 免费在线看成人av| 欧美精品一区二区久久婷婷| 青青草国产精品97视觉盛宴| 欧美日韩aaa| 狠狠色丁香久久婷婷综合_中| 久久夜色精品一区| www.欧美精品一二区| 一区二区在线观看不卡| 欧美三电影在线| 精品无人码麻豆乱码1区2区| 日韩黄色小视频| 一区二区三区产品免费精品久久75| 国产日韩欧美激情| 亚洲精品日韩一| 色综合久久久久网| 亚洲午夜一区二区三区| 欧美日韩午夜影院| 免费观看一级欧美片| 精品国产免费一区二区三区四区| 久久爱www久久做| 中文字幕在线观看一区二区| 欧美性猛交xxxx乱大交退制版| 日韩和欧美一区二区三区| 久久久精品免费免费| 色综合一个色综合|