⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 transportdlg.cpp

📁 模拟交通中
💻 CPP
📖 第 1 页 / 共 3 页
字号:
   m_input_cheng2=sqrt(m_input_fre2*(m_input_interval2-m_input_interval));

   	for(i=0;i<m_inputN;i++)
	{
       
		if((generateN[0][i]>m_input_interval2)&&(generateN[0][i]<=m_input_interval3))
            m_input_fre3=m_input_fre3+1;
   
	}
   m_input_cheng3=sqrt(m_input_fre3*(m_input_interval3-m_input_interval2));

   	for(i=0;i<m_inputN;i++)
	{
       
		if((generateN[0][i]>m_input_interval3)&&(generateN[0][i]<=m_input_interval4))
            m_input_fre4=m_input_fre4+1;
   
	}
   m_input_cheng4=sqrt(m_input_fre4*(m_input_interval4-m_input_interval3));

   	for(i=0;i<m_inputN;i++)
	{
       
		if((generateN[0][i]>m_input_interval4)&&(generateN[0][i]<=m_input_interval5))
            m_input_fre5=m_input_fre5+1;
   
	}
   m_input_cheng5=sqrt(m_input_fre5*(m_input_interval5-m_input_interval4));


	 UpdateData(false);

    MessageBox("计算累计值完毕!");



}

void CTransPortDlg::OnOK() 
{
	// TODO: Add extra validation here
	
 
	UpdateData(true);
    int i,j,ii;
////////////////////////////////////////////////////////////////////////////////////  
	float tempnumb=0;
	float tempdata=0;//aver
	float tempfangcha=0;
	float layererror[8];

	float m_show_layerror1,m_show_layerror2,m_show_layerror3,m_show_layerror4,m_show_layerror5;
    float m_show_layerror_ab1,m_show_layerror_ab2,m_show_layerror_ab3,m_show_layerror_ab4,m_show_layerror_ab5;
	float tempdata_ab=0;//aver
	float tempfangcha_ab=0;
	float layererror_ab[8];

	float guji_sum_a=0;
    float guji_sum_ab=0;

	for(i=0;i<m_input_n;i++)
	{

		if((select_n[0][i]>0)&&(select_n[0][i]<=m_input_layflay1))
		{
			tempnumb=tempnumb+1;
			tempdata=tempdata+select_n[0][i];
            tempdata_ab=tempdata_ab+(select_n[0][i]*select_n[1][i]);

		}
               

	}
	m_shown1 = tempnumb;
    if(tempnumb!=0)
	{
      tempdata=tempdata/tempnumb;

	  tempdata_ab=tempdata_ab/tempnumb;
	}
	else
	{
       tempdata=0;
       tempdata_ab=0;
	}
	m_shownavern1 = tempdata;
    
    for(i=0;i<m_input_n;i++)
	{

		if((select_n[0][i]>0)&&(select_n[0][i]<=m_input_layflay1))
		{
		
			tempfangcha=tempfangcha+((select_n[0][i]-tempdata)*(select_n[0][i]-tempdata));
            tempfangcha_ab=tempfangcha_ab+((select_n[0][i]*select_n[1][i]-tempdata_ab)*(select_n[0][i]*select_n[1][i]-tempdata_ab));
		
		}
               

	}
    tempfangcha=tempfangcha/(tempnumb-1);
	tempfangcha_ab=tempfangcha_ab/(tempnumb-1);
    m_show_layerror1 = tempfangcha;
    m_show_layerror_ab1=tempfangcha_ab;
	layererror[0]=m_show_layerror1;
    layererror_ab[0]=m_show_layerror_ab1;
 
////////////////////////////////////////////
	int sumdata_ofall_inthisinterval=0;
	for(i=0;i<m_inputN;i++)
		{

		if((generateN[0][i]>0)&&(generateN[0][i]<=m_input_layflay1))
		{
			sumdata_ofall_inthisinterval=sumdata_ofall_inthisinterval+1;
			
		}
               

		}
	m_showN1 = sumdata_ofall_inthisinterval;
	guji_sum_a=guji_sum_a+(sumdata_ofall_inthisinterval*tempdata);
    guji_sum_ab=guji_sum_ab+(sumdata_ofall_inthisinterval*tempdata_ab);

///////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////  
	tempnumb=0;
	tempdata=0;//aver
	tempfangcha=0;

	tempdata_ab=0;//aver
	tempfangcha_ab=0;
	

	for(i=0;i<m_input_n;i++)
	{

		if((select_n[0][i]>m_input_layflay1)&&(select_n[0][i]<=m_input_layflay2))
		{
			tempnumb=tempnumb+1;
			tempdata=tempdata+select_n[0][i];
			tempdata_ab=tempdata_ab+(select_n[0][i]*select_n[1][i]);

		}
               

	}

	

    if(tempnumb!=0)
	{
      tempdata=tempdata/tempnumb;

	  tempdata_ab=tempdata_ab/tempnumb;
	}
	else
	{
       tempdata=0;
       tempdata_ab=0;
	}
    for(i=0;i<m_input_n;i++)
	{

		if((select_n[0][i]>m_input_layflay1)&&(select_n[0][i]<=m_input_layflay2))
		{
			tempfangcha=tempfangcha+((select_n[0][i]-tempdata)*(select_n[0][i]-tempdata));
			tempfangcha_ab=tempfangcha_ab+((select_n[0][i]*select_n[1][i]-tempdata_ab)*(select_n[0][i]*select_n[1][i]-tempdata_ab));
		
		}
               

	}
    tempfangcha=tempfangcha/(tempnumb-1);
    m_show_layerror2 = tempfangcha;
	layererror[1]=m_show_layerror2;

	tempfangcha_ab=tempfangcha_ab/(tempnumb-1);
    m_show_layerror_ab2=tempfangcha_ab;
	layererror_ab[1]=m_show_layerror_ab2;
////////////////////////////////////////////////////////
	sumdata_ofall_inthisinterval=0;
	for(i=0;i<m_inputN;i++)
		{

		if((generateN[0][i]>m_input_layflay1)&&(generateN[0][i]<=m_input_layflay2))
		{
			sumdata_ofall_inthisinterval=sumdata_ofall_inthisinterval+1;
			
		}
               

		}
		m_shown2 = tempnumb;
		m_shownavern2 = tempdata;
		m_showN2 = sumdata_ofall_inthisinterval;

	guji_sum_a=guji_sum_a+(sumdata_ofall_inthisinterval*tempdata);
    guji_sum_ab=guji_sum_ab+(sumdata_ofall_inthisinterval*tempdata_ab);
////////////////////////////////////////////////////////////////////////////////////  
	tempnumb=0;
	tempdata=0;//aver
	tempfangcha=0;

	tempdata_ab=0;//aver
	tempfangcha_ab=0;

	for(i=0;i<m_input_n;i++)
	{

		if((select_n[0][i]>m_input_layflay2)&&(select_n[0][i]<=m_input_layflay3))
		{
			tempnumb=tempnumb+1;
			tempdata=tempdata+select_n[0][i];
			tempdata_ab=tempdata_ab+(select_n[0][i]*select_n[1][i]);

		}
               

	}

	
    if(tempnumb!=0)
	{
      tempdata=tempdata/tempnumb;

	  tempdata_ab=tempdata_ab/tempnumb;
	}
	else
	{
       tempdata=0;
       tempdata_ab=0;
	}
    for(i=0;i<m_input_n;i++)
	{

		if((select_n[0][i]>m_input_layflay2)&&(select_n[0][i]<=m_input_layflay3))
		{
			tempfangcha=tempfangcha+((select_n[0][i]-tempdata)*(select_n[0][i]-tempdata));
			tempfangcha_ab=tempfangcha_ab+((select_n[0][i]*select_n[1][i]-tempdata_ab)*(select_n[0][i]*select_n[1][i]-tempdata_ab));
		
		}
               

	}
    tempfangcha=tempfangcha/(tempnumb-1);
    m_show_layerror3 = tempfangcha;
    layererror[2]=m_show_layerror3;

	tempfangcha_ab=tempfangcha_ab/(tempnumb-1);
    m_show_layerror_ab3=tempfangcha_ab;
	layererror_ab[2]=m_show_layerror_ab3;
////////////////////////////////////////////////////////
	sumdata_ofall_inthisinterval=0;
	for(i=0;i<m_inputN;i++)
		{

		if((generateN[0][i]>m_input_layflay2)&&(generateN[0][i]<=m_input_layflay3))
		{
			sumdata_ofall_inthisinterval=sumdata_ofall_inthisinterval+1;
			
		}
               

		}
	m_shown3 = tempnumb;
		m_shownavern3 = tempdata;
		m_showN3 = sumdata_ofall_inthisinterval;

	guji_sum_a=guji_sum_a+(sumdata_ofall_inthisinterval*tempdata);
    guji_sum_ab=guji_sum_ab+(sumdata_ofall_inthisinterval*tempdata_ab);
////////////////////////////////////////////////////////////////////////////////////  
	tempnumb=0;
	tempdata=0;//aver
	tempfangcha=0;

	tempdata_ab=0;//aver
	tempfangcha_ab=0;

	for(i=0;i<m_input_n;i++)
	{

		if((select_n[0][i]>m_input_layflay3)&&(select_n[0][i]<=m_input_layflay4))
		{
			tempnumb=tempnumb+1;
			tempdata=tempdata+select_n[0][i];
			tempdata_ab=tempdata_ab+(select_n[0][i]*select_n[1][i]);

		}
               

	}

	
    if(tempnumb!=0)
	{
      tempdata=tempdata/tempnumb;

	  tempdata_ab=tempdata_ab/tempnumb;
	}
	else
	{
       tempdata=0;
       tempdata_ab=0;
	}

    for(i=0;i<m_input_n;i++)
	{

		if((select_n[0][i]>m_input_layflay3)&&(select_n[0][i]<=m_input_layflay4))
		{
			tempfangcha=tempfangcha+((select_n[0][i]-tempdata)*(select_n[0][i]-tempdata));
			tempfangcha_ab=tempfangcha_ab+((select_n[0][i]*select_n[1][i]-tempdata_ab)*(select_n[0][i]*select_n[1][i]-tempdata_ab));
		
		}
               

	}
    tempfangcha=tempfangcha/(tempnumb-1);
    m_show_layerror4 = tempfangcha;
    layererror[3]=m_show_layerror4;

	tempfangcha_ab=tempfangcha_ab/(tempnumb-1);
    m_show_layerror_ab4=tempfangcha_ab;
	layererror_ab[3]=m_show_layerror_ab4;
////////////////////////////////////////////////////////
	sumdata_ofall_inthisinterval=0;
	for(i=0;i<m_inputN;i++)
		{

		if((generateN[0][i]>m_input_layflay3)&&(generateN[0][i]<=m_input_layflay4))
		{
			sumdata_ofall_inthisinterval=sumdata_ofall_inthisinterval+1;
			
		}
               

		}
	m_shown4 = tempnumb;
		m_shownavern4 = tempdata;
		m_showN4 = sumdata_ofall_inthisinterval;

	guji_sum_a=guji_sum_a+(sumdata_ofall_inthisinterval*tempdata);
    guji_sum_ab=guji_sum_ab+(sumdata_ofall_inthisinterval*tempdata_ab);
////////////////////////////////////////////////////////////////////////////////////  
	tempnumb=0;
	tempdata=0;//aver
	tempfangcha=0;

	tempdata_ab=0;//aver
	tempfangcha_ab=0;


	for(i=0;i<m_input_n;i++)
	{

		if((select_n[0][i]>m_input_layflay4)&&(select_n[0][i]<=m_input_layflay5))
		{
			tempnumb=tempnumb+1;
			tempdata=tempdata+select_n[0][i];
			tempdata_ab=tempdata_ab+(select_n[0][i]*select_n[1][i]);

		}
               

	}

	
    if(tempnumb!=0)
	{
      tempdata=tempdata/tempnumb;

	  tempdata_ab=tempdata_ab/tempnumb;
	}
	else
	{
       tempdata=0;
       tempdata_ab=0;
	}

    for(i=0;i<m_input_n;i++)
	{

		if((select_n[0][i]>m_input_layflay4)&&(select_n[0][i]<=m_input_layflay5))
		{
			tempfangcha=tempfangcha+((select_n[0][i]-tempdata)*(select_n[0][i]-tempdata));
			tempfangcha_ab=tempfangcha_ab+((select_n[0][i]*select_n[1][i]-tempdata_ab)*(select_n[0][i]*select_n[1][i]-tempdata_ab));
		
		}
               

	}
    tempfangcha=tempfangcha/(tempnumb-1);
    m_show_layerror5 = tempfangcha;
    layererror[4]=m_show_layerror5;

	tempfangcha_ab=tempfangcha_ab/(tempnumb-1);
    m_show_layerror_ab5=tempfangcha_ab;
	layererror_ab[4]=m_show_layerror_ab5;
////////////////////////////////////////////////////////
	sumdata_ofall_inthisinterval=0;
	for(i=0;i<m_inputN;i++)
		{

		if((generateN[0][i]>m_input_layflay4)&&(generateN[0][i]<=m_input_layflay5))
		{
			sumdata_ofall_inthisinterval=sumdata_ofall_inthisinterval+1;
			
		}
               

		}
	m_shown5 = tempnumb;
		m_shownavern5 = tempdata;
		m_showN5 = sumdata_ofall_inthisinterval;

	guji_sum_a=guji_sum_a+(sumdata_ofall_inthisinterval*tempdata);
    guji_sum_ab=guji_sum_ab+(sumdata_ofall_inthisinterval*tempdata_ab);
////////////////////////////////////////////////////////////////////////////////////  
///////////////////////////////////////////////////////////////////////////////////  
   	 UpdateData(false);
//////////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -