/***************************************
*                                      *
*              状態初期化              *
*                                      *
*                                      *
***************************************/

#include <iostream>
#include "snaps.h"
#include "kisosu.h"

void zero()
{
	// 変数宣言
	int nendo;
	int shubetu;
	int jukyu_nenrei;
	int nenrei;
	int dankai;
	int kokko;
	int menjo_jokyo;
	int counter;
	int counter2;
	
	
	// 被保険者
	Hihokensha_Zero.ninzu = 0.;
	Hihokensha_Zero.kikan = 0.;
	Hihokensha_Zero.noufu = 0.;
	for( dankai = 0 ; dankai <= MAX_MENJO - 1 ; dankai++ )
	{
		for( kokko = 0 ; kokko <= KOKKO_HIKIAGE - 1 ; kokko++ )
		{
			Hihokensha_Zero.menjo[dankai][kokko] = 0.;
		}
	}
	Hihokensha_Zero.gakusei = 0.;
	Hihokensha_Zero.wakamono = 0.;
	Hihokensha_Zero.fuka = 0.;
	
	for( shubetu = 0 ; shubetu <= MAX_SHUBETU - 1 ; shubetu++ )
	{
		for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI + 1 ; nenrei++ )
			{
				Hiho_Kei[shubetu][nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				Hiho_Kei_P[shubetu][nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				Hiho_Kei_Nendokan[shubetu][nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				Hiho_Noufu[shubetu][nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				Hiho_Noufu_P[shubetu][nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				Hiho_Noufu_Nendokan[shubetu][nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				Fuka_Hiho[shubetu][nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				Fuka_Hiho_P[shubetu][nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				Fuka_Hiho_Nendokan[shubetu][nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				for( menjo_jokyo = 0 ; menjo_jokyo <= MENJO_JOKYO - 1 ; menjo_jokyo++ )
				{
					Hiho_Menjo[shubetu][nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = 0.;
					Hiho_Menjo_P[shubetu][nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = 0.;
					Hiho_Menjo_Nendokan[shubetu][nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = 0.;
				}
			}
		}
	}
	
	// パート適用
	for( shubetu = 0 ; shubetu <= MAX_SHUBETU - 1 ; shubetu++ )
	{
		for( counter = 0 ; counter <= 2 ; counter++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI + 1 ; nenrei++ )
			{
				for( counter2 = 0 ; counter2 <= 1 ; counter2++ )
				{
					Part_Taishou[shubetu][counter][nenrei - MIN_HIHO_NENREI][counter2] = 0.;
					Part_Noufu[shubetu][counter][nenrei - MIN_HIHO_NENREI][counter2] = 0.;
					Part_Fuka[shubetu][counter][nenrei - MIN_HIHO_NENREI][counter2] = 0.;
					for( dankai = 0 ; dankai <= MAX_MENJO - 1 ; dankai++ )
					{
						Part_Menjo[shubetu][counter][nenrei - MIN_HIHO_NENREI][dankai][counter2] = 0.;
					}
				}
			}
		}
	}
	
	// 待期者
	Taikisha_Zero.ninzu = 0.;
	Taikisha_Zero.kikan = 0.;
	Taikisha_Zero.noufu = 0.;
	for( dankai = 0 ; dankai <= MAX_MENJO - 1 ; dankai++ )
	{
		for( kokko = 0 ; kokko <= KOKKO_HIKIAGE - 1 ; kokko++ )
		{
			Taikisha_Zero.menjo[dankai][kokko] = 0.;
		}
	}
	Taikisha_Zero.gakusei = 0.;
	Taikisha_Zero.wakamono = 0.;
	Taikisha_Zero.fuka = 0.;
	
	for( shubetu = 0 ; shubetu <= MAX_SHUBETU + 2 ; shubetu++ )
	{
		for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
		{
			// 老齢年金
			for( nenrei = NENREI_SUM ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
			{
				for( jukyu_nenrei = MIN_ROREI_JUKYU ; jukyu_nenrei <= 70 + 1 ; jukyu_nenrei++ )
				{
	 				Rorei[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu = 0.;
					Rorei[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].noufu = 0.;
					for( dankai = 0 ; dankai <= MAX_MENJO - 1 ; dankai++ )
					{
						for( kokko = 0 ; kokko <= KOKKO_HIKIAGE - 1 ; kokko++ )
						{
							Rorei[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].menjo[dankai][kokko] = 0.;
						}
					}
					Rorei[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].rofuku_shitasasae = 0.;
					Rorei[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].fuka = 0.;
					
					Rorei_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu = 0.;
					Rorei_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].noufu = 0.;
					Rorei_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].menjo = 0.;
					Rorei_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].kasa_noufu = 0.;
					Rorei_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].kasa_menjo = 0.;
					Rorei_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].rofuku_shitasasae = 0.;
					Rorei_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].fuka = 0.;
					
					Turo_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu = 0.;
					Turo_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].noufu = 0.;
					Turo_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].menjo = 0.;
					Turo_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].kasa_noufu = 0.;
					Turo_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].kasa_menjo = 0.;
					Turo_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].rofuku_shitasasae = 0.;
					Turo_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].fuka = 0.;
					
					Gonen[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu = 0.;
					Gonen[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].noufu = 0.;
	 			}
	 		}
			
			// 障害年金
			for( nenrei = NENREI_SUM ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
			{
				Shogai_Ippan[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].ninzu = 0.;
				Shogai_Ippan[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].kihon = 0.;
				Shogai_Ippan[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].kakyu = 0.;
				Shogai_Ippan[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].menjo_kihon = 0.;
				Shogai_Ippan[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].menjo_kakyu = 0.;
				
				Shogai_20mae[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].ninzu = 0.;
				Shogai_20mae[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].kihon = 0.;
				Shogai_20mae[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].kakyu = 0.;
				Shogai_20mae[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].menjo_kihon = 0.;
				Shogai_20mae[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].menjo_kakyu = 0.;
				
				Shogai_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].ninzu = 0.;
				Shogai_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].kihon = 0.;
				Shogai_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].kakyu = 0.;
				Shogai_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].menjo_kihon = 0.;
				Shogai_Kyu[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].menjo_kakyu = 0.;
			}
			
			// 遺族年金 
			for( nenrei = NENREI_SUM ; nenrei <= MAX_IZOKU_TUMA_JUKYU ; nenrei++ )
			{
				Izoku_Tuma[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].ninzu = 0.;
				Izoku_Tuma[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].kihon = 0.;
				Izoku_Tuma[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].kakyu = 0.;
			}
			
			for( nenrei = NENREI_SUM ; nenrei <= MAX_IZOKU_OTTO_JUKYU ; nenrei++ )
			{
				Izoku_Otto[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].ninzu = 0.;
				Izoku_Otto[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].kihon = 0.;
				Izoku_Otto[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].kakyu = 0.;
			}
			
			Izoku_Ko[shubetu][nendo - SHONENDO].ninzu = 0.;
			Izoku_Ko[shubetu][nendo - SHONENDO].kihon = 0.;
			Izoku_Ko[shubetu][nendo - SHONENDO].kakyu = 0.;
			
			Kafu[shubetu][nendo - SHONENDO].ninzu = 0.;
			Kafu[shubetu][nendo - SHONENDO].noufu = 0.;
			for( dankai = 0 ; dankai <= MAX_MENJO - 1 ; dankai++ )
			{
				for( kokko = 0 ; kokko <= KOKKO_HIKIAGE - 1 ; kokko++ )
				{
					Kafu[shubetu][nendo - SHONENDO].menjo[dankai][kokko] = 0.;
				}
			}
			
			Kafu_Kyu[shubetu][nendo - SHONENDO].ninzu = 0.;
			Kafu_Kyu[shubetu][nendo - SHONENDO].noufu = 0.;
			for( dankai = 0 ; dankai <= MAX_MENJO - 1 ; dankai++ )
			{
				for( kokko = 0 ; kokko <= KOKKO_HIKIAGE - 1 ; kokko++ )
				{
					Kafu_Kyu[shubetu][nendo - SHONENDO].menjo[dankai][kokko] = 0.;
				}
			}
			
			for( nenrei = NENREI_SUM ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				Ichijikin[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].ninzu = 0.;
				Ichijikin[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].kyufu = 0.;
				Ichijikin[shubetu][nendo - SHONENDO][nenrei - NENREI_SUM].kyufu_fuka = 0.;
			}
		}
	}
}
