亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
色噜噜狠狠色综合欧洲selulu| 亚洲人成小说网站色在线| 欧美96一区二区免费视频| 欧美日韩国产一级| 日韩中文字幕麻豆| 99re在线视频这里只有精品| 国产欧美一区二区精品秋霞影院| 首页国产欧美日韩丝袜| 亚洲人成在线播放网站岛国| 国产精品欧美久久久久无广告| 日韩女优制服丝袜电影| 8x8x8国产精品| 欧美日韩黄色一区二区| 日本久久精品电影| 亚洲精选视频在线| 久久综合成人精品亚洲另类欧美| 99国产精品99久久久久久| 免费观看久久久4p| 国产精品丝袜黑色高跟| 亚洲国产视频在线| 国产精品免费视频网站| 精品欧美黑人一区二区三区| 在线观看视频一区二区 | 成人av手机在线观看| 五月综合激情网| 亚洲国产精品影院| 综合色中文字幕| 成人欧美一区二区三区1314 | 欧美性色aⅴ视频一区日韩精品| 国内偷窥港台综合视频在线播放| 美女在线视频一区| 国产又粗又猛又爽又黄91精品| 日本va欧美va精品发布| 99re免费视频精品全部| 欧美丝袜丝交足nylons| 精品一区免费av| 五月天激情小说综合| 亚洲欧洲日韩一区二区三区| 欧美三级中文字幕在线观看| 国产成人精品免费一区二区| 九九在线精品视频| 亚洲欧美激情在线| 亚洲精选在线视频| 亚洲国产一区二区三区| 日韩经典一区二区| 精品无人码麻豆乱码1区2区| 免费看日韩精品| 亚洲无线码一区二区三区| 伊人夜夜躁av伊人久久| 亚洲一区在线视频观看| 人禽交欧美网站| 国产suv精品一区二区6| 99久久精品免费看国产免费软件| 不卡一区二区三区四区| 欧美日韩综合不卡| 国产欧美精品一区二区三区四区 | 欧美性大战久久久久久久蜜臀| 欧美日韩国产精选| 国产午夜精品一区二区三区嫩草| 亚洲色图另类专区| 国产一区二区三区电影在线观看| a级精品国产片在线观看| 欧美日韩国产综合一区二区| 国产午夜精品福利| 亚洲综合自拍偷拍| 成av人片一区二区| 波多野结衣在线一区| 精品嫩草影院久久| 亚洲人成亚洲人成在线观看图片| 美女脱光内衣内裤视频久久网站 | 欧洲亚洲国产日韩| 国产精品狼人久久影院观看方式| 日本欧美一区二区三区乱码| proumb性欧美在线观看| 亚洲国产精品成人久久综合一区| 盗摄精品av一区二区三区| 久久综合久久久久88| 欧美一区二区三区性视频| 久久99精品国产麻豆婷婷| 亚洲靠逼com| 欧美国产日韩一二三区| 日韩午夜在线播放| 久久66热re国产| 国产亚洲综合av| 91精品国产手机| 成人黄色综合网站| 亚洲日本护士毛茸茸| 欧美人体做爰大胆视频| 亚洲一卡二卡三卡四卡五卡| 69堂国产成人免费视频| 日日摸夜夜添夜夜添国产精品 | 亚洲第一福利一区| 国产女主播在线一区二区| 91麻豆精品国产91久久久久| 色婷婷av一区二区| 国产一区在线观看麻豆| 免费在线欧美视频| 一级做a爱片久久| 欧美一区二区三区在线视频| 91在线一区二区| 国产精品77777竹菊影视小说| 中文字幕中文字幕一区| 精品sm在线观看| 丁香激情综合国产| 精品一区二区三区免费观看| 日本sm残虐另类| 日韩成人精品视频| 国产一区高清在线| 成人国产精品视频| 成人福利视频网站| 粉嫩av一区二区三区在线播放| 国产一区二区网址| 成人午夜在线视频| 91视频免费播放| 欧美日本乱大交xxxxx| 欧美日韩午夜影院| 日韩欧美在线不卡| 懂色av噜噜一区二区三区av| 成人aaaa免费全部观看| 欧美亚洲综合久久| 三级久久三级久久| 天天操天天干天天综合网| 国产麻豆精品视频| 成人动漫视频在线| 日韩欧美在线网站| 亚洲综合在线第一页| 亚洲国产精品嫩草影院| 欧美大片国产精品| eeuss鲁片一区二区三区在线看 | 91福利视频久久久久| 亚洲香肠在线观看| 亚洲三级视频在线观看| 欧美激情综合五月色丁香| 亚洲国产高清在线观看视频| 国产一区久久久| 中文字幕巨乱亚洲| 成人av资源在线观看| 国产成人午夜电影网| 久久国内精品视频| 国产成人小视频| 99免费精品在线| 欧美精品第1页| 国产欧美日韩麻豆91| 中文字幕在线不卡| 亚洲一区二区av电影| 亚洲成a天堂v人片| 激情欧美一区二区三区在线观看| 国产精品一卡二| 国产成人av电影| 在线精品视频小说1| 欧美亚洲国产一区二区三区va| 欧美三电影在线| 2020国产精品自拍| 亚洲蜜桃精久久久久久久| 午夜精品123| 国产黄人亚洲片| 欧美日韩亚洲另类| 久久精品综合网| 日韩美女视频一区二区| 香蕉久久夜色精品国产使用方法 | 蜜臀av性久久久久蜜臀aⅴ| 国产乱人伦精品一区二区在线观看| av电影天堂一区二区在线观看| 欧美精品久久一区| 中文字幕不卡在线播放| 日本成人在线电影网| 9l国产精品久久久久麻豆| 91精品福利在线一区二区三区 | 亚洲成人激情综合网| 国内精品久久久久影院薰衣草| 日本韩国欧美一区二区三区| 精品精品国产高清a毛片牛牛| 亚洲欧美综合在线精品| 久久久久一区二区三区四区| 日韩中文欧美在线| 国产999精品久久久久久绿帽| 91精品国产乱码久久蜜臀| 亚洲三级小视频| 国产激情91久久精品导航 | 91视频免费看| 国产日韩v精品一区二区| 亚洲h在线观看| 欧美羞羞免费网站| 久久久久久久久久久黄色| 午夜国产不卡在线观看视频| 91女人视频在线观看| 国产精品久久久99| 国产99久久久国产精品潘金 | 成人少妇影院yyyy| 日韩欧美色综合网站| 三级在线观看一区二区| 91视频你懂的| 亚洲欧洲99久久| 99久久久无码国产精品| 中文字幕在线观看一区二区| 国产福利91精品一区二区三区| 欧美中文字幕一区| 亚洲大尺度视频在线观看| 欧洲另类一二三四区| 亚洲精品精品亚洲|