Exemplo n.º 1
0
        /// <summary>
        /// Registers the genetic members.
        /// </summary>
        public static void RegisterGeneticMembers()
        {
            RegistrationManager.AddOperator(OperatorTypeEnum.And, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticBool);
            RegistrationManager.AddOperator(OperatorTypeEnum.Equal, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticBool);
            RegistrationManager.AddOperator(OperatorTypeEnum.Equal, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticGridDirection, GeneticTypeEnum.GeneticGridDirection);
            RegistrationManager.AddOperator(OperatorTypeEnum.Equal, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticInt, GeneticTypeEnum.GeneticInt);
            RegistrationManager.AddOperator(OperatorTypeEnum.Minus, GeneticTypeEnum.GeneticInt, GeneticTypeEnum.GeneticInt, GeneticTypeEnum.GeneticInt);
            RegistrationManager.AddOperator(OperatorTypeEnum.NotEqual, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticBool);
            RegistrationManager.AddOperator(OperatorTypeEnum.NotEqual, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticGridDirection, GeneticTypeEnum.GeneticGridDirection);
            RegistrationManager.AddOperator(OperatorTypeEnum.NotEqual, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticInt, GeneticTypeEnum.GeneticInt);
            RegistrationManager.AddOperator(OperatorTypeEnum.Or, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticBool);
            RegistrationManager.AddOperator(OperatorTypeEnum.Plus, GeneticTypeEnum.GeneticInt, GeneticTypeEnum.GeneticInt, GeneticTypeEnum.GeneticInt);

            RegistrationManager.AddReadOnlyVariable(EntVariableEnum.Health, GeneticTypeEnum.GeneticInt);
            RegistrationManager.AddReadOnlyVariable(EntVariableEnum.AttackStrength, GeneticTypeEnum.GeneticInt);
            RegistrationManager.AddReadOnlyVariable(EntVariableEnum.GrowFoodStrength, GeneticTypeEnum.GeneticInt);

            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperInt1, GeneticTypeEnum.GeneticInt);
            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperInt2, GeneticTypeEnum.GeneticInt);
            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperBool1, GeneticTypeEnum.GeneticBool);
            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperBool2, GeneticTypeEnum.GeneticBool);
            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperGridDirection1, GeneticTypeEnum.GeneticGridDirection);
            RegistrationManager.AddReadWriteVariable(EntVariableEnum.HelperGridDirection2, GeneticTypeEnum.GeneticGridDirection);

            RegistrationManager.AddLeftMethod(EntMethodEnum.Reproduce, GeneticTypeEnum.Void, GeneticTypeEnum.GeneticGridDirection);
            RegistrationManager.AddLeftMethod(EntMethodEnum.Move, GeneticTypeEnum.Void, GeneticTypeEnum.GeneticGridDirection);
            RegistrationManager.AddLeftMethod(EntMethodEnum.Attack, GeneticTypeEnum.Void, GeneticTypeEnum.GeneticGridDirection);
            RegistrationManager.AddLeftMethod(EntMethodEnum.GrowFood, GeneticTypeEnum.Void);

            RegistrationManager.AddRightMethod(EntMethodEnum.DirectionIsOccupied, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticGridDirection);
            RegistrationManager.AddRightMethod(EntMethodEnum.DirectionIsEnemy, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticGridDirection);
            RegistrationManager.AddRightMethod(EntMethodEnum.DirectionIsFriend, GeneticTypeEnum.GeneticBool, GeneticTypeEnum.GeneticGridDirection);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Registers the operators.
 /// </summary>
 public static void RegisterOperators()
 {
     RegistrationManager.AddOperator("<", typeof(GeneticBool), typeof(GeneticInt), typeof(GeneticInt));
     RegistrationManager.AddOperator(">", typeof(GeneticBool), typeof(GeneticInt), typeof(GeneticInt));
     RegistrationManager.AddOperator("==", typeof(GeneticBool), typeof(GeneticInt), typeof(GeneticInt));
     RegistrationManager.AddOperator("==", typeof(GeneticBool), typeof(GeneticBool), typeof(GeneticBool));
     RegistrationManager.AddOperator("!=", typeof(GeneticBool), typeof(GeneticInt), typeof(GeneticInt));
     RegistrationManager.AddOperator("!=", typeof(GeneticBool), typeof(GeneticBool), typeof(GeneticBool));
     RegistrationManager.AddOperator("&&", typeof(GeneticBool), typeof(GeneticBool), typeof(GeneticBool));
     RegistrationManager.AddOperator("||", typeof(GeneticBool), typeof(GeneticBool), typeof(GeneticBool));
 }