public System.Object PropertyUpdate(SIMONObject a, SIMONObject[] b)
	{
		GameObject myObject;
		myObject = GameObject.Find (a.ObjectID);
		int count = 0, count_H1 = 0, count_H2 = 0, count_H3=0,count_H4=0;
		int count_E1 = 0, count_E2 = 0, count_E3=0,count_E4=0;
		double positionX = 0.0d;
		double positionY = 0.0d;
		double myPositionX = myObject.transform.position.x;
		double myPositionY = myObject.transform.position.y;
		double disX, disY;
		Vector2 p;
		float distance;
		if(a.GetPropertyElement("Type") == 2)
		{
			if (myObject.GetComponent<SIMON_Controller>().animator.GetCurrentAnimatorStateInfo (0).IsTag ("Stay")) 
			{
				a.SetPropertyElement("isCheck",1);
			}
		}
		else
		{
			if (myObject.GetComponent<UsualAI_Controller>().animator.GetCurrentAnimatorStateInfo (0).IsTag ("Stay")) 
			{
				a.SetPropertyElement("isCheck",1);
			}
		}
		a.SetPropertyElement ("PositionX", (double)myObject.transform.position.x);
		a.SetPropertyElement ("PositionY", (double)myObject.transform.position.y);
		
		for(int i = 0; i < b.Length; i++)
		{
			if(b[i].GetPropertyElement ("CurHp") <= 0)
			{
				continue;
			}
			
			if(b[i].GetPropertyElement ("Attack_Target")== a.GetPropertyElement("ID"))
			{
				if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
					count++;
			}
			positionX = b[i].GetPropertyElement ("PositionX");
			positionY = b[i].GetPropertyElement ("PositionY");
			p = new Vector2((float)positionX,(float)positionY);
			
			distance = Vector2.Distance(p,myObject.transform.position);
			
			if(distance < a.GetPropertyElement("Monster_Sight"))
			{
				disX = positionX - myPositionX;
				disY = positionY - myPositionY;
				if(disX > 0 && disY > 0)
				{
					if(disY - disX > 0)
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H1++;
						else
							count_E1++;
					}
					else
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H4++;
						else
							count_E4++;
					}
					
				}
				else if(disX < 0 && disY > 0)
				{
					if(disY - (disX * -1.0d) > 0)
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H1++;
						else
							count_E1++;
					}
					else
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H2++;
						else
							count_E2++;
					}
				}
				else if(disX < 0 && disY < 0)
				{
					if((disY * -1.0d) - (disX * -1.0d) > 0)
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H3++;
						else
							count_E3++;
					}
					else
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H2++;
						else
							count_E2++;
					}
				}
				else if(disX > 0 && disY < 0)
				{
					if((disY * -1.0d) - disX > 0)
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H3++;
						else
							count_E3++;
					}
					else
					{
						if(a.GetPropertyElement("Type") == b[i].GetPropertyElement("Type"))
							count_H4++;
						else
							count_E4++;
					}
				}
			}
		}
		
		a.SetPropertyElement ("AttackedCount", (double)count);
		a.SetPropertyElement ("Monster_Enemy_1", (double)count_E1);
		a.SetPropertyElement ("Monster_Enemy_2", (double)count_E2);
		a.SetPropertyElement ("Monster_Enemy_3", (double)count_E3);
		a.SetPropertyElement ("Monster_Enemy_4", (double)count_E4);
		a.SetPropertyElement ("Monster_Home_1", (double)count_H1);
		a.SetPropertyElement ("Monster_Home_2", (double)count_H2);
		a.SetPropertyElement ("Monster_Home_3", (double)count_H3);
		a.SetPropertyElement ("Monster_Home_4", (double)count_H4);
		
		
		
		return -1000000.0d;
	}
	public Object Monster_defense(SIMONObject a, SIMONObject[] b)
	{
		a.SetPropertyElement ("State", (double)3.0d);
		a.SetPropertyElement ("Attack_Target", -1.0d);
		a.SetPropertyElement ("Move_Target", -1.0d);
		a.SetPropertyElement ("Target",-1.0d);
		return null;
	}
	public Object Monster_attack(SIMONObject a, SIMONObject[] b)
	{
		a.SetPropertyElement("State",2.0d);
		a.SetPropertyElement ("Move_Target", -1.0d);
		a.SetPropertyElement("Target",a.GetPropertyElement("Attack_Target"));
		return null;
	}
	public Object monster_Skill_Defensive(SIMONObject a, SIMONObject[] b)
	{
		a.SetPropertyElement ("Skill_number", 5);
		return null;
	}
	public Object monster_Skill_Range(SIMONObject a, SIMONObject[] b)
	{
		a.SetPropertyElement ("Skill_number", 7);
		return null;
	}
	public System.Object ActionFunction_Skill_CON(SIMONObject a, SIMONObject[] b)
	{
		double MaxValue= -1000000.0d;
		double tempValue = 0.0d;
		double hp =a.GetPropertyElement("CurHp");
		double total_hp = a.GetPropertyElement ("HP");
		double attackedCount = a.GetPropertyElement ("AttackedCount");

		double geneA, geneB, geneC ,geneD;
		
		if (a.GetPropertyElement ("CON") < 20)
			return MaxValue;
		
		
		if (a.GetPropertyElement ("Type") == 1) 
		{
			if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_6")) && !isSkill) 
			{
				a.SetPropertyElement("coolTime_Skill_Start_6",(double)Time.time);
				MaxValue = 1000000.0d;
			}
			return MaxValue;
		}
		
		
		if(SimulationType == 1)
		{
			geneA = 44.0d;
			geneB = 100.0d;
			geneC = 100.0d;
			geneD = 1.0d;
		}
		else
		{
			geneA = a.GetActionObject("Skill_CON"  ).FindWeight ("CON_Gene_A");
			geneB =	a.GetActionObject("Skill_CON"  ).FindWeight ("CON_Gene_B");
			geneC =	a.GetActionObject("Skill_CON"  ).FindWeight ("CON_Gene_C");
			geneD =	a.GetActionObject("Skill_CON"  ).FindWeight ("CON_Gene_D");
		}
		
		
		if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_6")) && !isSkill) 
		{
			a.SetPropertyElement("coolTime_Skill_Start_6",(double)Time.time);
			for(int i = 0 ; i < b.Length ; i++)
			{
				if(b[i].GetPropertyElement("CurHp") <=0)
					continue;
				if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
				{
					tempValue =((scoreConversion(-1.0d * total_hp,hp)*geneA)
					            )*4.0d;
					if(MaxValue < tempValue)
					{
						MaxValue = tempValue;
					}
				}
			}
		}
		return MaxValue;
	}
	public System.Object ActionFunction_Move(SIMONObject a, SIMONObject[] b)
	{
		double MaxValue = -1000000.0d;
		double tempValue = 0.0d;
		double hp =a.GetPropertyElement("CurHp");
		double damage = a.GetPropertyElement ("Monster_Damage");
		double attack_Speed = a.GetPropertyElement ("Monster_Attack_Speed");
		double attackedCount = a.GetPropertyElement ("AttackedCount");
		double defensive = a.GetPropertyElement("Defensive");
		double total_hp = a.GetPropertyElement ("HP");
		
		double geneA, geneC, geneD;
		double pointX = a.GetPropertyElement ("PositionX");
		double pointY = a.GetPropertyElement ("PositionY");
		Vector2 a_v;
		
		GameObject Target_Temp;
		
		if(SimulationType == 1)
		{
			geneA = -0.5d;
			geneC = 0.0d;
			geneD = 4.0d;
		}
		else
		{
			geneA =	a.GetActionObject("Move").FindWeight ("Move_Gene_A");
			geneC =	a.GetActionObject("Move").FindWeight ("Move_Gene_C");
			geneD = a.GetActionObject("Move").FindWeight ("Move_Gene_D");
		}
		
		
		Target_Temp = GameObject.Find ("Player");
		double player_hp = Target_Temp.GetComponent<Player_Controller> ().HC.NowHealth;
		double player_total_hp = Target_Temp.GetComponent <Player_Controller> ().HC.TotalHealth;
		
		if(player_hp > 0 && a.GetPropertyElement("Type") == 1)
		{
			a_v= new Vector2((float)pointX,(float)pointY);
			MaxValue =((scoreConversion(-1.0d * player_total_hp,player_hp)*geneA)+
			           (scoreConversion(-25.0d,a.GetPropertyElement("AttackedCount"))*geneC)+
			           (scoreConversion(19.0d,dis)*geneD)
			           );
			
			a.SetPropertyElement("Move_Target",0.0d);
		}
		for(int i = 0; i < b.Length ; i++)
		{
			if(b[i].GetPropertyElement("CurHp") <=0)
				continue;
			if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
			{
				Target_Temp = GameObject.Find (b[i].ObjectID);
				a_v= new Vector2((float)pointX,(float)pointY);
				dis = Vector2.Distance (a_v, Target_Temp.transform.position);
				tempValue =((scoreConversion(-1.0d * b[i].GetPropertyElement("HP"),b[i].GetPropertyElement("CurHp"))*geneA)+
				            (scoreConversion(-25.0d,a.GetPropertyElement("AttackedCount"))*geneC)+
				            (scoreConversion(19.0d,dis)*geneD)
				            );
				if(MaxValue < tempValue)
				{
					MaxValue = tempValue;
					a.SetPropertyElement("Move_Target",b[i].GetPropertyElement("ID"));
				}
			}
		}
		
		return MaxValue;
	}
	public System.Object ActionFunction_Attack(SIMONObject a, SIMONObject[] b)
	{
		double MaxValue = -1000000.0d;
		double tempValue = 0.0d;
		double hp =a.GetPropertyElement("CurHp");
		double damage = a.GetPropertyElement ("Monster_Damage");
		double attack_Speed = a.GetPropertyElement ("Monster_Attack_Speed");
		double attackedCount = a.GetPropertyElement ("AttackedCount");
		double defensive = a.GetPropertyElement("Defensive");
		double total_hp = a.GetPropertyElement ("HP");
		
		double geneA, geneC, geneD;
		double pointX = a.GetPropertyElement ("PositionX");
		double pointY = a.GetPropertyElement ("PositionY");
		Vector2 a_v;
		
		GameObject Target_Temp;
		if (a.GetPropertyElement ("Type") == 1) 
		{
			for (int i = 0; i < b.Length; i++) 
			{
				if(b[i].GetPropertyElement("CurHp") <=0)
					continue;
				if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
				{
					Target_Temp = GameObject.Find (b[i].ObjectID);
					a_v= new Vector2((float)pointX,(float)pointY);
					dis = Vector2.Distance (a_v, Target_Temp.transform.position);
					if (dis < a.GetPropertyElement("Monster_Range")) 
					{
						tempValue = 100000.0d - b[i].GetPropertyElement("CurHp")+100000;
						if(MaxValue < tempValue)
						{
							MaxValue = tempValue;
							a.SetPropertyElement("Attack_Target",b[i].GetPropertyElement("ID"));
							a.SetPropertyElement("Monster_Enemy_Defensive",b[i].GetPropertyElement("Monster_Defensive"));
							a.SetPropertyElement("Monster_Enemy_CurHp",b[i].GetPropertyElement("CurHp"));
						}       
					}
				}
			}
			
			return MaxValue;
		}
		
		if(SimulationType == 1)
		{
			geneA = 192.0d;
			geneC = 20.0d;
			geneD = 2.4d;
		}
		else
		{
			geneA = a.GetActionObject("Attack").FindWeight ("Attack_Gene_A");
			geneC = a.GetActionObject("Attack").FindWeight ("Attack_Gene_C");
			geneD = a.GetActionObject("Attack").FindWeight ("Attack_Gene_D");
		}
		
	
		for (int i = 0; i < b.Length; i++) 
		{
			if(b[i].GetPropertyElement("CurHp") <=0)
				continue;
			if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
			{
				Target_Temp = GameObject.Find (b[i].ObjectID);
				a_v= new Vector2((float)pointX,(float)pointY);
				dis = Vector2.Distance (a_v, Target_Temp.transform.position);
				if (dis < a.GetPropertyElement("Monster_Range")) 
				{
					tempValue =((scoreConversion(-1.0d * b[i].GetPropertyElement("HP"),b[i].GetPropertyElement("CurHp"))*geneA)+
					            (scoreConversion(-25.0d,a.GetPropertyElement("AttackedCount"))*geneC)+
					            (scoreConversion(-19.0d,dis)*geneD)
					            );
					if(MaxValue < tempValue)
					{
						MaxValue = tempValue;
						a.SetPropertyElement("Attack_Target",b[i].GetPropertyElement("ID"));
						a.SetPropertyElement("Monster_Enemy_Defensive",b[i].GetPropertyElement("Monster_Defensive"));
						a.SetPropertyElement("Monster_Enemy_CurHp",b[i].GetPropertyElement("CurHp"));
					}       
				}
			}
		}
		
		return MaxValue;
		
		
	}
	public Object monster_Skill_Strength(SIMONObject a, SIMONObject[] b)
	{
		a.SetPropertyElement ("Skill_number", 1);
		return null;
	}
	public object ExecutionFinish(SIMONObject s, SIMONObject[] o){
		if(CurrentIteration<ObjectSize)
		{
			Debug.Log(CurrentIteration+" "+s.GetPropertyElement("Angle1")+" "+s.GetPropertyElement("Angle2")+" "+ball.position.x);
			save (s);
			init ();
			state = (State)(((int)state + 1) % StateNumber);
			s.SetPropertyElement ("State", (double)State.Init);
		}
		else //save & learn
		{
			SIMON.GlobalSIMON.SIMONLearn(ObjectList);

			IterationFlag = true;
			save (s);
			init ();
			state = (State)(((int)state + 1) % StateNumber);
			s.SetPropertyElement ("State", (double)State.Init);
		}

		return 1.0;
	}
	void save2(SIMONObject s)
	{
		s.SetPropertyElement("Result", ball.position.x);
		//ObjectList.Add (s.ObjectID, s);
		CurrentIteration++;
	}
	public object ExecutionShoot(SIMONObject s, SIMONObject[] o){
		if(ball.position.y < position_limit)
		{
			state = (State)(((int)state + 1) % StateNumber);
			s.SetPropertyElement ("State", (double)State.Finish);
		}
		return 1.0;
	}
	public object ExecutionArm2(SIMONObject s, SIMONObject[] o){
		//Debug.Log((double)s.GetPropertyElement("Angle2")+" "+arm2.rotation.eulerAngles.z+" "+(arm2.rotation.eulerAngles.z-(float)s.GetPropertyElement("Angle2")));

		if(Mathf.Abs( arm2.rotation.eulerAngles.z-a12) <= angle_error )
		{
			//Debug.Log((double)s.GetPropertyElement("Angle2")+" "+arm2.rotation.eulerAngles.z+" "+(arm2.rotation.eulerAngles.z-(float)s.GetPropertyElement("Angle2")));
			state = (State)(((int)state + 1) % StateNumber);
			s.SetPropertyElement ("State", (double)State.Shoot);
		}
		return 1.0;
	}
	public object ExecutionStart(SIMONObject s, SIMONObject[] o){
		state = (State)(((int)state + 1) % StateNumber);
		s.SetPropertyElement ("State", (double)State.Phase1);
		return 1.0;
	}
	public System.Object ActionFunction_Skill_Critical(SIMONObject a, SIMONObject[] b)
	{
		double MaxValue= -1000000.0d;
		double hp =a.GetPropertyElement("CurHp");
		double damage = a.GetPropertyElement ("Monster_Damage");
		double attack_Speed = a.GetPropertyElement ("Monster_Attack_Speed");
		double tempValue = 0.0d;
		double geneA, geneB, geneC ,geneD;
		double pointX = a.GetPropertyElement ("PositionX");
		double pointY = a.GetPropertyElement ("PositionY");
		Vector2 a_v;
		
		GameObject Target_Temp;
		
		if (a.GetPropertyElement ("Critical") < 20)
			return MaxValue;
		
		if (a.GetPropertyElement ("Type") == 1) 
		{
			if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_4")) && !isSkill) 
			{
				a.SetPropertyElement("coolTime_Skill_Start_4",(double)Time.time);
				MaxValue = 1000000.0d;
			}
			return MaxValue;
		}
		if(SimulationType == 1)
		{
			geneA = -2.0d;
			geneB = 195.0d;
			geneC = 43.0d;
			geneD = -3.0d;
		}
		else
		{
			geneA =	a.GetActionObject("Skill_Critical"  ).FindWeight ("Critical_Gene_A");
			geneB =	a.GetActionObject("Skill_Critical"  ).FindWeight ("Critical_Gene_B");
			geneC =	a.GetActionObject("Skill_Critical"  ).FindWeight ("Critical_Gene_C");
			geneD = a.GetActionObject("Skill_Critical"  ).FindWeight ("Critical_Gene_D");
		}

		
		
	
		if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_4")) && !isSkill) 
		{
			a.SetPropertyElement("coolTime_Skill_Start_4",(double)Time.time);
			for(int i = 0 ; i < b.Length ; i++)
			{
				if(b[i].GetPropertyElement("CurHp") <=0)
					continue;
				if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
				{
					
					Target_Temp = GameObject.Find (b[i].ObjectID);
					a_v= new Vector2((float)pointX,(float)pointY);
					dis = Vector2.Distance (a_v, Target_Temp.transform.position);
					tempValue =((scoreConversion(-1.0d * b[i].GetPropertyElement("HP"),b[i].GetPropertyElement("CurHp"))*geneA)+
					            (scoreConversion(25.0d,b[i].GetPropertyElement("AttackedCount"))*geneB)+
					            (scoreConversion(-25.0d,a.GetPropertyElement("AttackedCount"))*geneC)+
					            (scoreConversion(-19.0d,dis)*geneD)
					            )*2.0d;
					if(MaxValue < tempValue)
					{
						MaxValue = tempValue;
					}
				}
			}
		}
		return MaxValue;
	}
	public Object monster_Skill_Moving_Speed(SIMONObject a, SIMONObject[] b)
	{
		a.SetPropertyElement ("Skill_number", 3);
		return null;
	}
	public System.Object ActionFunction_Skill_Defensive(SIMONObject a, SIMONObject[] b)
	{
		double MaxValue= -1000000.0d;
		double tempValue = 0.0d;	
		double hp =a.GetPropertyElement("CurHp");
		double total_hp = a.GetPropertyElement ("HP");
		double attackedCount = a.GetPropertyElement ("AttackedCount");
		
		double Total_Home = a.GetPropertyElement("Monster_Home_1")+ a.GetPropertyElement("Monster_Home_2") +
			a.GetPropertyElement("Monster_Home_3")+a.GetPropertyElement("Monster_Home_4");
		
		double Total_Enemy = a.GetPropertyElement("Monster_Enemy_1")+ a.GetPropertyElement("Monster_Enemy_2") +
			a.GetPropertyElement("Monster_Enemy_3")+a.GetPropertyElement("Monster_Enemy_4");
		
		double geneA, geneB, geneC , geneD;


		if (a.GetPropertyElement ("Defensive") < 20)
			return MaxValue;
		
		if (a.GetPropertyElement ("Type") == 1) 
		{
			if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_5")) && !isSkill) 
			{
				a.SetPropertyElement("coolTime_Skill_Start_5",(double)Time.time);
				MaxValue = 1000000.0d;
			}
			return MaxValue;
		}
		
		
		
		if(SimulationType == 1)
		{
			geneA = 400.0d;
			geneB = -1.0d;
			geneC = 6.0d;
			geneD = 5.0d;
		}
		else
		{
			geneA =	a.GetActionObject("Skill_Defensive"  ).FindWeight ("Defensive_Gene_A");
			geneB =	a.GetActionObject("Skill_Defensive"  ).FindWeight ("Defensive_Gene_B");
			geneC =	a.GetActionObject("Skill_Defensive"  ).FindWeight ("Defensive_Gene_C");
			geneD =	a.GetActionObject("Skill_Defensive"  ).FindWeight ("Defensive_Gene_D");
		}
		
		if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_5")) && !isSkill) 
		{
			a.SetPropertyElement("coolTime_Skill_Start_5",(double)Time.time);
			for(int i = 0 ; i < b.Length ; i++)
			{
				if(b[i].GetPropertyElement("CurHp") <=0)
					continue;
				if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
				{
					tempValue =((scoreConversion(-1.0d * total_hp,hp)*geneA)+
					            (scoreConversion(25.0d,Total_Home)*geneB)+
					            (scoreConversion(25.0d,Total_Enemy)*geneD)+
					            (scoreConversion(25.0d,attackedCount)*geneC)
					            )*2.0d;
					if(MaxValue < tempValue)
					{
						MaxValue = tempValue;
					}
				}
			}
		}
		return MaxValue;
	}
	public Object monster_Skill_Critical(SIMONObject a, SIMONObject[] b)
	{
		a.SetPropertyElement ("Skill_number", 4);
		return null;
	}
	public System.Object ActionFunction_Skill_Range(SIMONObject a, SIMONObject[] b)
	{
		double MaxValue= -1000000.0d;
		double Total_Enemy = a.GetPropertyElement("Monster_Enemy_1")+ a.GetPropertyElement("Monster_Enemy_2") +
			a.GetPropertyElement("Monster_Enemy_3")+a.GetPropertyElement("Monster_Enemy_4");
		double tempValue = 0.0d;
		
		double geneA, geneB, geneC , geneD;
		
		if (a.GetPropertyElement ("Range") < 20)
			return MaxValue;
		
		if (a.GetPropertyElement ("Type") == 1) 
		{
			if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_7")) && !isSkill) 
			{
				a.SetPropertyElement("coolTime_Skill_Start_7",(double)Time.time);
				MaxValue = 1000000.0d;
			}
			return MaxValue;
		}
		
		
		if(SimulationType == 1)
		{
			geneA = -48.0d;
			geneB = 22.0d;
			geneC = 24.0d;
			geneD = 176.0d;
		}
		else
		{
			geneA = a.GetActionObject("Skill_Range"  ).FindWeight ("Range_Gene_A");
			geneB =	a.GetActionObject("Skill_Range"  ).FindWeight ("Range_Gene_B");
			geneC = a.GetActionObject("Skill_Range"  ).FindWeight ("Range_Gene_C");
			geneD = a.GetActionObject("Skill_Range"  ).FindWeight ("Range_Gene_D");
		}
		
		if (a.GetPropertyElement ("Range") < 20)
			return MaxValue;
		
		if (isSkillCoolTime((float)a.GetPropertyElement("coolTime_Skill_Start_7")) && !isSkill) 
		{
			a.SetPropertyElement("coolTime_Skill_Start_7",(double)Time.time);
			for(int i = 0 ; i < b.Length ; i++)
			{
				if(b[i].GetPropertyElement("CurHp") <=0)
					continue;
				if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
				{
					tempValue =((scoreConversion(-25.0d,Total_Enemy)*geneA)
					            )*4.0d;
					if(MaxValue < tempValue)
					{
						MaxValue = tempValue;
					}
				}
			}
		}
		return MaxValue;
	}
	public System.Object ActionFunction_Avoid(SIMONObject a, SIMONObject[] b)
	{
		double MaxValue= -1000000.0d;
		double tempValue = 0.0d;	
		double hp =a.GetPropertyElement("CurHp");
		double total_hp = a.GetPropertyElement ("HP");
		double attackedCount = a.GetPropertyElement ("AttackedCount");
		
		double Total_Home = a.GetPropertyElement("Monster_Home_1")+ a.GetPropertyElement("Monster_Home_2") +
			a.GetPropertyElement("Monster_Home_3")+a.GetPropertyElement("Monster_Home_4");
		
		double Total_Enemy = a.GetPropertyElement("Monster_Enemy_1")+ a.GetPropertyElement("Monster_Enemy_2") +
			a.GetPropertyElement("Monster_Enemy_3")+a.GetPropertyElement("Monster_Enemy_4");
		
		double geneA, geneB, geneD;
		if(SimulationType == 1)
		{
			geneA = -35.0d;
			geneB = -0.4d;
			geneD = -15.0d;
		}
		else
		{
			geneA =	a.GetActionObject("Avoid").FindWeight ("Avoid_Gene_A");
			geneB = 	a.GetActionObject("Avoid").FindWeight ("Avoid_Gene_B");
			geneD = a.GetActionObject("Avoid").FindWeight ("Avoid_Gene_D");
		}
		
		if(a.GetPropertyElement("AttackedCount")==0)
		{
			return MaxValue;
		}
		if (a.GetPropertyElement ("HP") == hp) 
		{
			return MaxValue;
		}
		for (int i = 1; i < b.Length; i++) 
		{
			if(a.GetPropertyElement("Type") != b[i].GetPropertyElement("Type"))
			{
				tempValue =((scoreConversion(-1.0d * total_hp,hp)*geneA)+
				            (scoreConversion(-25.0d,Total_Home)*geneB)+
				            (scoreConversion(25.0d,Total_Enemy)*geneD)
				            );
				if(MaxValue < tempValue)
				{
					MaxValue = tempValue;
					a.SetPropertyElement("Monster_Avoid_State",1.0d);
				}
			}
		}
		return MaxValue;
	}