本文整理汇总了C#中SIMONFramework.SIMONObject.GetPropertyElement方法的典型用法代码示例。如果您正苦于以下问题:C# SIMONObject.GetPropertyElement方法的具体用法?C# SIMONObject.GetPropertyElement怎么用?C# SIMONObject.GetPropertyElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SIMONFramework.SIMONObject
的用法示例。
在下文中一共展示了SIMONObject.GetPropertyElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
//.........这里部分代码省略.........
//init arm1
arm1 = GameObject.Find ("Arm1").transform;
arm1_render = GameObject.Find ("Arm1").renderer;
//arm1.GetComponent<SpriteRenderer> ().transform.position = new Vector3(
arm1_size = arm1_render.bounds.size;
//arm1.localScale = new Vector3(1/arm1_size.x*arm1_scale_x,1/arm1_size.y*arm1_scale_y,1/arm1_size.z);
arm1_halfsize = transform.localScale.y / 2.0f;
arm1_axis = new Vector3 (arm1.position.x, -arm1_halfsize-arm1.position.y, arm1.position.z);
//Debug.Log(-halfsize-transform.position.y);
arm1.RotateAround (arm1_axis, new Vector3 (0, 0, 1), 90f);
//init arm2
arm2 = GameObject.Find ("Arm2").transform;
arm2_render = GameObject.Find ("Arm2").renderer;
arm2_size = arm2_render.bounds.size;
//arm2.localScale = new Vector3(1/arm2_size.x*arm2_scale_x,1/arm2_size.y*arm2_scale_y,1/arm2_size.z);
//set arm
joint_position = new Vector3(arm1.position.x-1.0f/2.0f*arm1.localScale.y*Mathf.Sin(arm1.rotation.eulerAngles.z*Mathf.Deg2Rad), arm1.position.y+1.0f/2.0f*arm1.localScale.y*Mathf.Cos(arm1.rotation.eulerAngles.z*Mathf.Deg2Rad), arm1.position.z);
arm2.rotation = Quaternion.Euler (new Vector3(arm1.rotation.eulerAngles.x,arm1.rotation.eulerAngles.y,arm1.rotation.eulerAngles.z+arm2_angle));
Vector3 arm2_normal = new Vector3(Mathf.Sin(arm2.rotation.eulerAngles.z*Mathf.Deg2Rad)/2.0f*arm2.localScale.y,Mathf.Cos(arm2.rotation.eulerAngles.z*Mathf.Deg2Rad)/2.0f*arm2.localScale.y,0);
arm2.position = new Vector3((joint_position.x - arm2_normal.x),(joint_position.y + arm2_normal.y),arm2.position.z);
//init ball
ball = GameObject.Find ("Ball").transform;
ball_render = GameObject.Find ("Ball").renderer;
ball_size = ball_render.bounds.size;
ball.localScale = new Vector3(1/ball_size.x*ball_scale_x,1/ball_size.y*ball_scale_y,1/ball_size.z);
//SIMON
float a1 = Random.Range (-87, 87);
float a2 = Random.Range (-87, 87);
if (a1 < 0) {
a1 = 360+a1;
}
if(a2<0){
a2 = 360+a2;
}
controller = new SIMONObject ();
controller.ObjectID = "Controller"+CurrentIteration;
controller.Properties.Add (new SIMONProperty("Angle1", a1, true));
controller.Properties.Add (new SIMONProperty("Angle2", a2, true));
controller.Properties.Add (new SIMONProperty("State", 0.0, false));
controller.Properties.Add (new SIMONProperty("State1", 0.0, true));
controller.Properties.Add (new SIMONProperty("State2", 0.0, true));
controller.Properties.Add (new SIMONProperty("State3", 0.0, true));
controller.Properties.Add (new SIMONProperty("Result", 0.0, false));
controller.ObjectFitnessFunctionName = "FitnessProperty";
controller.UpdatePropertyDNA ();
//dummy gene
System.Collections.Generic.List<SIMONGene> armGene = new System.Collections.Generic.List<SIMONGene> ();
controller.Actions.Add (new SIMONAction("MoveStart", "ActionStart", "ExecutionStart", "FitnessStart", armGene));
controller.Actions.Add (new SIMONAction("MoveArm1", "ActionArm1", "ExecutionArm1", "FitnessArm1", armGene));
controller.Actions.Add (new SIMONAction("MoveArm2", "ActionArm2", "ExecutionArm2", "FitnessArm2", armGene));
controller.Actions.Add (new SIMONAction("MoveShoot", "ActionShoot", "ExecutionShoot", "FitnessShoot", armGene));
controller.Actions.Add (new SIMONAction("MoveFinish", "ActionFinish", "ExecutionFinish", "FitnessFinish", armGene));
SIMONFunction fitnessDel = FitnessProperty;
SIMONFunction actionStart = ActionStart;
SIMONFunction actionArm1 = ActionArm1;
SIMONFunction actionArm2 = ActionArm2;
SIMONFunction actionShoot = ActionShoot;
SIMONFunction actionFinish = ActionFinish;
SIMONFunction executionStart = ExecutionStart;
SIMONFunction executionArm1 = ExecutionArm1;
SIMONFunction executionArm2 = ExecutionArm2;
SIMONFunction executionShoot = ExecutionShoot;
SIMONFunction executionFinish = ExecutionFinish;
SIMONFunction fitnessStart = FitnessStart;
SIMONFunction fitnessArm1 = FitnessArm1;
SIMONFunction fitnessArm2 = FitnessArm2;
SIMONFunction fitnessShoot = FitnessShoot;
SIMONFunction fitnessFinish = FitnessFinish;
SIMON.GlobalSIMON.InsertSIMONMethod ("FitnessProperty", fitnessDel);
SIMON.GlobalSIMON.InsertSIMONMethod ("ActionStart", actionStart);
SIMON.GlobalSIMON.InsertSIMONMethod ("ActionArm1", actionArm1);
SIMON.GlobalSIMON.InsertSIMONMethod ("ActionArm2", actionArm2);
SIMON.GlobalSIMON.InsertSIMONMethod ("ActionShoot", actionShoot);
SIMON.GlobalSIMON.InsertSIMONMethod ("ActionFinish", actionFinish);
SIMON.GlobalSIMON.InsertSIMONMethod ("ExecutionStart", executionStart);
SIMON.GlobalSIMON.InsertSIMONMethod ("ExecutionArm1", executionArm1);
SIMON.GlobalSIMON.InsertSIMONMethod ("ExecutionArm2", executionArm2);
SIMON.GlobalSIMON.InsertSIMONMethod ("ExecutionShoot", executionShoot);
SIMON.GlobalSIMON.InsertSIMONMethod ("ExecutionFinish", executionFinish);
SIMON.GlobalSIMON.InsertSIMONMethod ("FitnessStart", fitnessStart);
SIMON.GlobalSIMON.InsertSIMONMethod ("FitnessArm1", fitnessArm1);
SIMON.GlobalSIMON.InsertSIMONMethod ("FitnessArm2", fitnessArm2);
SIMON.GlobalSIMON.InsertSIMONMethod ("FitnessShoot", fitnessShoot);
SIMON.GlobalSIMON.InsertSIMONMethod ("FitnessFinish", fitnessFinish);
SIMON.GlobalSIMON.InsertSIMONObject (controller);
a12 = (float)controller.GetPropertyElement("Angle2")+(float)controller.GetPropertyElement("Angle1");
a12 %= 360;
}
示例2: ActionFunction_Defense
public System.Object ActionFunction_Defense(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 (a.GetPropertyElement ("Type") == 1)
{
if (a.GetPropertyElement ("HP") / 2 > a.GetPropertyElement ("CurHp"))
{
MaxValue = Random.Range(100,200);
}
return MaxValue;
}
if(SimulationType == 1)
{
geneA = 80.0d;
geneB = -17.0d;
geneD = -9.0d;
}
else
{
geneA = a.GetActionObject("Defense").FindWeight ("Defense_Gene_A");
geneB = a.GetActionObject("Defense").FindWeight ("Defense_Gene_B");
geneD = a.GetActionObject("Defense").FindWeight ("Defense_Gene_D");
}
if (a.GetPropertyElement ("AttackedCount") == 0)
{
return MaxValue;
}
if (a.GetPropertyElement ("HP") == hp)
{
return MaxValue;
}
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)
);
if(MaxValue < tempValue)
{
MaxValue = tempValue;
}
}
}
return MaxValue;
}
示例3: ActionFunction_Skill_CON
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;
}
示例4: ActionFunction_Move
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;
}
示例5: FitnessFunction_Skill_Range
public System.Object FitnessFunction_Skill_Range(SIMONObject a, SIMONObject[] b)
{
double value;
value = a.GetPropertyElement("Monster_Total_Damage");
return value;
}
示例6: ActionFunction_Skill_Critical
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;
}
示例7: FitnessProperty
public object FitnessProperty(SIMONObject s, SIMONObject[] o){
return s.GetPropertyElement ("Result");
}
示例8: FitnessFunction_Attack
public System.Object FitnessFunction_Attack(SIMONObject a, SIMONObject[] b)
{
double value;
value = a.GetPropertyElement("Monster_Total_Damage")/a.GetPropertyElement("Monster_Total_AttackCount");
return value;
}
示例9: FitnessFunction_Skill_Moving_Speed
public System.Object FitnessFunction_Skill_Moving_Speed(SIMONObject a, SIMONObject[] b)
{
double value;
value = a.GetPropertyElement("Monster_Total_Damage");
if (value > 9999.0d)
value = 9000.0d;
if (value < -9000.0d)
value = -9000.0d;
return value;
}
示例10: FitnessFunction_Skill_Range
public System.Object FitnessFunction_Skill_Range(SIMONObject a, SIMONObject[] b)
{
double value;
value = a.GetPropertyElement("Monster_Range_Value");
if (value > 9999.0d)
value = 9000.0d;
if (value < -9000.0d)
value = -9000.0d;
return value;
}
示例11: FitnessFunction_Avoid
public System.Object FitnessFunction_Avoid(SIMONObject a, SIMONObject[] b)
{
double value = 0.0001d;
if(NormalGameSceneManager_Simulation.whoIsWin ==(int)a.GetPropertyElement("Type"))
value = a.GetPropertyElement("Monster_Avoid_Value");
if (value > 9999.9999d)
value = 9000.0d;
if (value < -9000.0d)
value = -9000.0d;
return value;
}
示例12: ObjectFitness
public System.Object ObjectFitness(SIMONObject a, SIMONObject[] b)
{
double value = 0.0001d;
if(NormalGameSceneManager_Simulation.whoIsWin ==(int)a.GetPropertyElement("Type"))
{
value = a.GetPropertyElement("Monster_Total_Damage");
if (value > 9999.0d)
value = 9000.0d;
if (value < -9000.0d)
value = -9000.0d;
}
return value;
}
示例13: Start
//.........这里部分代码省略.........
SIMONFunction ActionFunction_Attack_Name = ActionFunction_Attack;
SIMONFunction ExecutionFunction_Attack_Name = Monster_attack;
SIMONFunction FitnessFunction_Attack_Name = FitnessFunction_Attack;
SIMONFunction ActionFunction_Defense_Name = ActionFunction_Defense;
SIMONFunction ExecutionFunction_Defense_Name = Monster_defense;
SIMONFunction FitnessFunction_Defense_Name = FitnessFunction_Defense;
SIMONFunction ActionFunction_Avoid_Name = ActionFunction_Avoid;
SIMONFunction ExecutionFunction_Avoid_Name = Monster_avoid;
SIMONFunction FitnessFunction_Avoid_Name = FitnessFunction_Avoid;
//
SIMONFunction ActionFunction_Skill_Strength_Name = ActionFunction_Skill_Strength;
SIMONFunction ExecutionFunction_Skill_Strength_Name = monster_Skill_Strength;
SIMONFunction FitnessFunction_Skill_Strength_Name = FitnessFunction_Skill_Strength;
SIMONFunction ActionFunction_Skill_Attack_Speed_Name = ActionFunction_Skill_Attack_Speed;
SIMONFunction ExecutionFunction_Skill_Skill_Attack_Speed_Name = monster_Skill_Attack_Speed;
SIMONFunction FitnessFunction_Skill_Attack_Speed_Name = FitnessFunction_Skill_Attack_Speed;
SIMONFunction ActionFunction_Skill_Moving_Speed_Name = ActionFunction_Skill_Moving_Speed;
SIMONFunction ExecutionFunction_Skill_Skill_Moving_Speed_Name = monster_Skill_Moving_Speed;
SIMONFunction FitnessFunction_Skill_Moving_Speed_Name = FitnessFunction_Skill_Moving_Speed;
SIMONFunction ActionFunction_Skill_Critical_Name = ActionFunction_Skill_Critical;
SIMONFunction ExecutionFunction_Skill_Skill_Critical_Name = monster_Skill_Critical;
SIMONFunction FitnessFunction_Skill_Critical_Name = FitnessFunction_Skill_Critical;
SIMONFunction ActionFunction_Skill_Defensive_Name = ActionFunction_Skill_Defensive;
SIMONFunction ExecutionFunction_Skill_Skill_Defensive_Name = monster_Skill_Defensive;
SIMONFunction FitnessFunction_Skill_Defensive_Name = FitnessFunction_Skill_Defensive;
SIMONFunction ActionFunction_Skill_CON_Name = ActionFunction_Skill_CON;
SIMONFunction ExecutionFunction_Skill_Skill_CON_Name = monster_Skill_CON;
SIMONFunction FitnessFunction_Skill_CON_Name = FitnessFunction_Skill_CON;
SIMONFunction ActionFunction_Skill_Range_Name = ActionFunction_Skill_Range;
SIMONFunction ExecutionFunction_Skill_Skill_Range_Name = monster_Skill_Range;
SIMONFunction FitnessFunction_Skill_Range_Name = FitnessFunction_Skill_Range;
//
SIMON.GlobalSIMON.InsertSIMONMethod("propertyUpdate", propertyUpdate_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("Execution_propertyUpdate" , ExecutionFunction_propertyUpdate_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_propertyUpdate" , FitnessFunction_propertyUpdate_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("ActionFunction_Move" , ActionFunction_Move_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("Monster_Move" , ExecutionFunction_Move_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_Move" , FitnessFunction_Move_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("ActionFunction_Attack" , ActionFunction_Attack_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("Monster_Attack" , ExecutionFunction_Attack_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_Attack" , FitnessFunction_Attack_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("ActionFunction_Defense" , ActionFunction_Defense_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("Monster_Defense" , ExecutionFunction_Defense_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_Defense" , FitnessFunction_Defense_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("ActionFunction_Avoid" , ActionFunction_Avoid_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("Monster_Avoid" , ExecutionFunction_Avoid_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_Avoid" , FitnessFunction_Avoid_Name);
//
SIMON.GlobalSIMON.InsertSIMONMethod("ActionFunction_Skill_Strength" , ActionFunction_Skill_Strength_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("Monster_Skill_Strength" , ExecutionFunction_Skill_Strength_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_Skill_Strength" , FitnessFunction_Skill_Strength_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("ActionFunction_Skill_Attack_Speed" , ActionFunction_Skill_Attack_Speed_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("Monster_Skill_Attack_Speed" , ExecutionFunction_Skill_Skill_Attack_Speed_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_Skill_Attack_Speed" , FitnessFunction_Skill_Attack_Speed_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("ActionFunction_Skill_Moving_Speed" , ActionFunction_Skill_Moving_Speed_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("Monster_Skill_Moving_Speed" , ExecutionFunction_Skill_Skill_Moving_Speed_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_Skill_Moving_Speed" , FitnessFunction_Skill_Moving_Speed_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("ActionFunction_Skill_Critical" , ActionFunction_Skill_Critical_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("Monster_Skill_Critical" , ExecutionFunction_Skill_Skill_Critical_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_Skill_Critical" , FitnessFunction_Skill_Critical_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("ActionFunction_Skill_Defensive" , ActionFunction_Skill_Defensive_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("Monster_Skill_Defensive" , ExecutionFunction_Skill_Skill_Defensive_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_Skill_Defensive" , FitnessFunction_Skill_Defensive_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("ActionFunction_Skill_CON" , ActionFunction_Skill_CON_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("Monster_Skill_CON" , ExecutionFunction_Skill_Skill_CON_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_Skill_CON" , FitnessFunction_Skill_CON_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("ActionFunction_Skill_Range" , ActionFunction_Skill_Range_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("Monster_Skill_Range" , ExecutionFunction_Skill_Skill_Range_Name);
SIMON.GlobalSIMON.InsertSIMONMethod("FitnessFunction_Skill_Range" , FitnessFunction_Skill_Range_Name);
//
setTotalHP((float)sObject.GetPropertyElement("HP"));
curDirection = 3;
isSkill = false;
}
示例14: ActionFunction_Attack
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;
}
示例15: ActionArm2
public object ActionArm2(SIMONObject s, SIMONObject[] o){
if((int)s.GetPropertyElement("State")==(int)State.Phase2)
return 1.0;
else
return 0.0;
}