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

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

?? simulation.cpp

?? 在任務級并行平臺P2HP上開發的demo應用
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// Simulation.cpp: implementation of the Simulation class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Perm.h"
#include "Simulation.h"
#include <TIME.H>
using namespace std;

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

Simulation::Simulation(ProteinSeq &tempseq, GlobePar &temppara):
sequence(tempseq),parameter(temppara){
	spaceSize = 2*sequence.getLength();
	initialized = false;
	bestRecoder = 0;
	space =(char*)malloc(spaceSize*spaceSize*spaceSize*sizeof(char));	
}

Simulation::~Simulation(){
	free(space);
}

/***Start the simulation. Take care that parameter.averageOfWei should be 
	initialized. There are two methods to initialize the parameter.averageOfWei
	1.use GlobePar's initial
	2.use Simulation's initializtion***/
void Simulation::run(){
	startTime = time((time_t *)NULL);
	resetTemp();
	resetMatrix();
	putFirstTwoPoint();
	recursion();
	endTime = time((time_t *)NULL);
	parameter.c0 += parameter.step;
}

/***return time used to  computing***/
long Simulation::usedTime() const{
	return (endTime-startTime);
}


/***The two function are used to get the special node in the matric***/
inline char Simulation::getSpaceNode(int x, int y, int z) const{
	return *(space+x*spaceSize*spaceSize+y*spaceSize+z);
}

inline void Simulation::setSpaceNode(int x, int y, int z, const char node){
	*(space+x*spaceSize*spaceSize+y*spaceSize+z) = node;
}

/***reset the temp result***/
void Simulation::resetTemp(){
	tempResult.clear();
	tempWeight.clear();
	tempEnergy.clear();
	tempTotalEnergy = 0;
}

/***set the Matric to zero***/
void Simulation::resetMatrix(){
//there is a probelm 
	register int i,j,k;
	for(i=0; i<spaceSize; i++)
		  for(j=0; j<spaceSize; j++)
			  for(k=0; k<spaceSize; k++ )
				setSpaceNode(i,j,k,'0');
}

/***compute the quality of the different directions***/
void Simulation::computingQuality(Quality &quality){
	quality.resetQuality();
	register int x,y,z;
	register char next_point = sequence.getSequence().GetAt(tempResult.size());
	x = tempResult.back().x;
	y = tempResult.back().y;
	z = tempResult.back().z;
	//the parameter in equation used to compute the quailty
	int next_Kfree;
	int e_increase;
	
	//compute the different direction and get the result;
	// 1. compute the parameter.directions[0]----forward
	if(getSpaceNode(x+1,y,z) == '0'){
		quality.k_free++;
		next_Kfree = 0;
		e_increase = 0;
		if(getSpaceNode(x+2,y,z) == '0') //forward
			next_Kfree++;
		if(getSpaceNode(x+1,y+1,z) == '0') //right
			next_Kfree++;
		if(getSpaceNode(x+1,y-1,z) == '0') //left
			next_Kfree++;
		if(getSpaceNode(x+1,y,z+1) == '0') //up
			next_Kfree++;
		if(getSpaceNode(x+1,y,z-1) == '0') //down
			next_Kfree++;
		
		if( next_point == 'H'){
			if(getSpaceNode(x+2,y,z) == 'H') //forward
				e_increase++;
			if(getSpaceNode(x+1,y+1,z) == 'H') //right
				e_increase++;
			if(getSpaceNode(x+1,y-1,z) == 'H') //left
				e_increase++;
			if(getSpaceNode(x+1,y,z+1) == 'H') //up
				e_increase++;
			if(getSpaceNode(x+1,y,z-1) == 'H') //down
				e_increase++;
		}
		quality.energy[0] = e_increase;
		quality.quality[0] = (next_Kfree + 0.5)*pow(parameter.Exp, e_increase);
	}
	// 2. compute the paramter.direction[1]----back
	if(getSpaceNode(x-1,y,z) == '0' ){
		quality.k_free++;
		next_Kfree = 0;
		e_increase = 0;
		if(getSpaceNode(x-2,y,z) == '0') //back
			next_Kfree++;
		if(getSpaceNode(x-1,y+1,z) == '0') //left
			next_Kfree++;
		if(getSpaceNode(x-1,y-1,z) == '0') //right
			next_Kfree++;
		if(getSpaceNode(x-1,y,z+1) == '0') //up
			next_Kfree++;
		if(getSpaceNode(x-1,y,z-1) == '0') //down
			next_Kfree++;
		
		if( next_point == 'H'){
			if(getSpaceNode(x-2,y,z) == 'H') //forward
				e_increase++;
			if(getSpaceNode(x-1,y+1,z) == 'H') //right
				e_increase++;
			if(getSpaceNode(x-1,y-1,z) == 'H') //left
				e_increase++;
			if(getSpaceNode(x-1,y,z+1) == 'H') //up
				e_increase++;
			if(getSpaceNode(x-1,y,z-1) == 'H') //down
				e_increase++;
		}
		quality.energy[1] = e_increase;
		quality.quality[1] = (next_Kfree + 0.5)*pow(parameter.Exp, e_increase);
	}
	// 3. compute the paramter.direction[2]----right
	if(getSpaceNode(x,y+1,z) == '0' ){
		quality.k_free++;
		next_Kfree = 0;
		e_increase = 0;
		if(getSpaceNode(x-1,y+1,z) == '0') 
			next_Kfree++;
		if(getSpaceNode(x+1,y+1,z) == '0') 
			next_Kfree++;
		if(getSpaceNode(x,y+2,z) == '0') 
			next_Kfree++;
		if(getSpaceNode(x,y+1,z+1) == '0') 
			next_Kfree++;
		if(getSpaceNode(x,y+1,z-1) == '0') 
			next_Kfree++;
		
		if( next_point == 'H'){
			if(getSpaceNode(x-1,y+1,z) == 'H') 
				e_increase++;
			if(getSpaceNode(x+1,y+1,z) == 'H') 
				e_increase++;
			if(getSpaceNode(x,y+2,z) == 'H') 
				e_increase++;
			if(getSpaceNode(x,y+1,z+1) == 'H') 
				e_increase++;
			if(getSpaceNode(x,y+1,z-1) == 'H') 
				e_increase++;
		}
		quality.energy[2] = e_increase;
		quality.quality[2] = (next_Kfree + 0.5)*pow(parameter.Exp, e_increase);
	}
	
	// 4. compute the paramter.direction[3]----left
		if(getSpaceNode(x,y-1,z) == '0' ){
		quality.k_free++;
		next_Kfree = 0;
		e_increase = 0;
		if(getSpaceNode(x,y-2,z) == '0') 
			next_Kfree++;
		if(getSpaceNode(x+1,y-1,z) == '0') 
			next_Kfree++;
		if(getSpaceNode(x-1,y-1,z) == '0') 
			next_Kfree++;
		if(getSpaceNode(x,y-1,z+1) == '0') 
			next_Kfree++;
		if(getSpaceNode(x,y-1,z-1) == '0') 
			next_Kfree++;
		
		if( next_point == 'H'){
			if(getSpaceNode(x,y-2,z) == 'H') 
				e_increase++;
			if(getSpaceNode(x+1,y-1,z) == 'H') 
				e_increase++;
			if(getSpaceNode(x-1,y-1,z) == 'H') 
				e_increase++;
			if(getSpaceNode(x,y-1,z+1) == 'H') 
				e_increase++;
			if(getSpaceNode(x,y-1,z-1) == 'H') 
				e_increase++;
		}
		quality.energy[3] = e_increase;
		quality.quality[3] = (next_Kfree + 0.5)*pow(parameter.Exp, e_increase);
	}

	// 5. compute the paramter.direction[4]----up
		if(getSpaceNode(x,y,z+1) == '0' ){
		quality.k_free++;
		next_Kfree = 0;
		e_increase = 0;
		if(getSpaceNode(x,y,z+2) == '0') 
			next_Kfree++;
		if(getSpaceNode(x+1,y,z+1) == '0') 
			next_Kfree++;
		if(getSpaceNode(x-1,y,z+1) == '0') 
			next_Kfree++;
		if(getSpaceNode(x,y+1,z+1) == '0') 
			next_Kfree++;
		if(getSpaceNode(x,y-1,z+1) == '0') 
			next_Kfree++;
		
		if( next_point == 'H'){
			if(getSpaceNode(x,y,z+2) == 'H') 
				e_increase++;
			if(getSpaceNode(x+1,y,z+1) == 'H') 
				e_increase++;
			if(getSpaceNode(x-1,y,z+1) == 'H') 
				e_increase++;
			if(getSpaceNode(x,y+1,z+1) == 'H') 
				e_increase++;
			if(getSpaceNode(x,y-1,z+1) == 'H') 
				e_increase++;
		}
		quality.energy[4] = e_increase;
		quality.quality[4] = (next_Kfree + 0.5)*pow(parameter.Exp, e_increase);
	}

	// 6. compute the paramter.direction[5]----down
		if(getSpaceNode(x,y,z-1) == '0' ){
		quality.k_free++;
		next_Kfree = 0;
		e_increase = 0;
		if(getSpaceNode(x,y,z-2) == '0') 
			next_Kfree++;
		if(getSpaceNode(x+1,y,z-1) == '0') 
			next_Kfree++;
		if(getSpaceNode(x-1,y,z-1) == '0') 
			next_Kfree++;
		if(getSpaceNode(x,y+1,z-1) == '0') 
			next_Kfree++;
		if(getSpaceNode(x,y-1,z-1) == '0') 
			next_Kfree++;
		
		if( next_point == 'H'){
			if(getSpaceNode(x,y,z-2) == 'H') 
				e_increase++;
			if(getSpaceNode(x+1,y,z-1) == 'H') 
				e_increase++;
			if(getSpaceNode(x-1,y,z-1) == 'H') 
				e_increase++;
			if(getSpaceNode(x,y+1,z-1) == 'H') 
				e_increase++;
			if(getSpaceNode(x,y-1,z-1) == 'H') 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人激情综合网站| 91精品国产欧美日韩| 色噜噜久久综合| 欧美日韩视频在线第一区 | 精品国产一区二区三区久久久蜜月 | 亚洲精品一区二区三区精华液| 精品1区2区在线观看| 国产精品久99| 三级久久三级久久| 国产精品一二三四| 一本到一区二区三区| 国产精品不卡一区| 亚洲不卡av一区二区三区| 久久99久国产精品黄毛片色诱| 成人午夜免费电影| 欧美丰满美乳xxx高潮www| 久久久久久久久久久久久夜| 洋洋成人永久网站入口| 国内外精品视频| 日本高清不卡一区| 久久久亚洲国产美女国产盗摄| 亚洲精品视频一区| 国产一区欧美一区| 欧美三级一区二区| 国产亚洲精品中文字幕| 亚洲成人免费在线观看| 成人一区二区三区在线观看| 这里只有精品免费| 综合久久国产九一剧情麻豆| 精品在线免费观看| 欧洲精品视频在线观看| 国产欧美一区二区精品仙草咪| 亚洲成a人片在线不卡一二三区| 高清不卡在线观看av| 3atv在线一区二区三区| 亚洲另类中文字| 国产福利视频一区二区三区| 正在播放亚洲一区| 亚洲一区二区不卡免费| 国产suv精品一区二区883| 日韩视频一区二区在线观看| 亚洲观看高清完整版在线观看| 不卡一区在线观看| 久久亚洲私人国产精品va媚药| 香蕉乱码成人久久天堂爱免费| 99久久精品国产网站| 久久久不卡影院| 久久精品国产秦先生| 欧美日韩免费电影| 亚洲精品亚洲人成人网| 成人激情动漫在线观看| 久久久久久9999| 裸体健美xxxx欧美裸体表演| 欧美精品久久99久久在免费线| 亚洲美女免费在线| 不卡电影一区二区三区| 久久精品一区二区三区四区| 久久99久久精品| 欧美大胆人体bbbb| 免费在线视频一区| 欧美丰满美乳xxx高潮www| 午夜亚洲福利老司机| 欧美专区亚洲专区| 亚洲一区欧美一区| 日本福利一区二区| 亚洲综合精品久久| 色综合咪咪久久| 亚洲日本在线视频观看| 91麻豆国产福利精品| 最新日韩av在线| 色综合天天综合色综合av| 自拍偷拍亚洲激情| 色婷婷一区二区| 一卡二卡三卡日韩欧美| 欧美优质美女网站| 亚洲电影在线播放| 欧美日本韩国一区| 日韩电影一区二区三区四区| 91精品国产综合久久精品图片| 婷婷国产在线综合| 欧美一区二区三区播放老司机| 日本在线不卡视频| 日韩亚洲欧美在线观看| 精品亚洲欧美一区| 国产视频一区在线播放| 成人动漫一区二区在线| 亚洲欧美偷拍三级| 欧美亚洲一区二区在线观看| 亚洲成人www| 日韩视频一区在线观看| 国产一区二区三区日韩| 欧美国产禁国产网站cc| 91丝袜呻吟高潮美腿白嫩在线观看| 亚洲精品中文字幕乱码三区| 欧美日本国产一区| 国产一区二区三区四区五区入口 | 国产成人免费视频精品含羞草妖精| 国产日韩欧美高清在线| 99国产精品久久久久| 丁香啪啪综合成人亚洲小说| 国产精品理伦片| 欧美日韩一区二区三区四区 | 日韩精品一区二区三区视频播放| 国产麻豆91精品| 亚洲欧美日韩久久| 在线不卡免费av| 狠狠色丁香久久婷婷综| 中文字幕亚洲综合久久菠萝蜜| 欧洲另类一二三四区| 久久66热re国产| 综合婷婷亚洲小说| 欧美丰满嫩嫩电影| 成人午夜在线视频| 亚洲成人黄色小说| 国产日韩欧美一区二区三区综合| 在线视频你懂得一区二区三区| 男男视频亚洲欧美| 中文字幕一区二区三区视频| 欧美乱妇23p| 丰满亚洲少妇av| 亚洲成av人影院| 久久精品视频免费观看| 欧美在线一二三| 国产高清无密码一区二区三区| 亚洲精品成人精品456| 欧美tickling挠脚心丨vk| 成人黄色网址在线观看| 日韩精品福利网| 国产精品妹子av| 日韩视频中午一区| 色综合色综合色综合| 韩国午夜理伦三级不卡影院| 亚洲自拍偷拍网站| 久久久精品免费观看| 欧美理论片在线| 不卡电影一区二区三区| 久久爱另类一区二区小说| 亚洲精选视频免费看| 国产亚洲一区二区三区| 91麻豆精品91久久久久同性| 暴力调教一区二区三区| 久久 天天综合| 午夜视频在线观看一区二区三区| 国产精品久久久久久久久动漫 | 奇米影视7777精品一区二区| 最近中文字幕一区二区三区| 26uuu亚洲综合色欧美| 欧美视频中文字幕| av不卡在线播放| 国产一区美女在线| 日本伊人午夜精品| 亚洲国产综合在线| 亚洲视频免费在线观看| 国产亚洲成av人在线观看导航| 欧美一区二区三区婷婷月色| 欧美亚洲日本一区| 91首页免费视频| 成人免费黄色在线| 国产一区中文字幕| 久久精品国产秦先生| 日韩影院在线观看| 亚洲第一电影网| 一区二区三区四区中文字幕| 亚洲欧洲日韩综合一区二区| 久久久.com| 久久久夜色精品亚洲| 日韩丝袜美女视频| 欧美一区二区三区视频免费播放| 欧美日韩一区二区三区不卡| 色婷婷精品久久二区二区蜜臀av| gogogo免费视频观看亚洲一| 高清shemale亚洲人妖| 国产美女娇喘av呻吟久久| 精品在线免费观看| 久久国产免费看| 久久99国产精品麻豆| 日韩va欧美va亚洲va久久| 午夜精品久久久久久久久久| 亚洲第一综合色| 亚洲成人av中文| 五月婷婷久久综合| 首页国产丝袜综合| 肉色丝袜一区二区| 日韩在线a电影| 蜜桃av噜噜一区| 激情综合色综合久久综合| 久久99精品国产91久久来源 | 亚洲国产成人自拍| 中文字幕av一区二区三区免费看 | 99热在这里有精品免费| 成av人片一区二区| 91香蕉视频黄| 欧美午夜片在线观看| 欧美另类久久久品| 欧美成人欧美edvon| 久久免费的精品国产v∧| 日本一区二区三区久久久久久久久不 | 亚洲一区二区三区四区五区黄| 亚洲一区二区三区中文字幕| 性做久久久久久免费观看|