public NeuralAI(Animal animal, Body body, DriveSystem drives, MotorSystem motor, SensorySystem senses, Phenotype phenotype) :
     base(body, drives, motor, senses, phenotype)
 {
     InitNetworkLayerInfoDict();
     InitLayers();
     InitConnections();
     GetOutputConnectionDict();
     InitInputs();
     InitOutputs();
     Feedforward();
 }
 void InitBodyControl(Vector3 spawn)
 {
     if (species == "Human")
     {
         animalBody  = new PrimateBody(this, spawn);
         motorSystem = new SimplePrimateMotorSystem(this);
     }
     else
     {
         animalBody = new AnimalBody(this, spawn);
     }
     body = animalBody;
     visualInputCamera = animalBody.GetGameObject().GetComponentInChildren <Camera>();
 }
Пример #3
0
        public override void Reset()
        {
            MotorSystem.Stop();
            MotorSystem = null;

            LastAttackTick = Environment.TickCount;
            LastMoveTick   = Environment.TickCount;

            Target = null;

            MotorSystem           = new Timer();
            MotorSystem.Interval += mThinkSpeed;
            MotorSystem.Elapsed  += new ElapsedEventHandler(MotorSystem_TakingDecision);
            if (mEntity.IsAlive())
            {
                MotorSystem.Start();
            }
        }
Пример #4
0
    public AI(Body body, DriveSystem drives, MotorSystem motor, SensorySystem senses, Phenotype phenotype)
    {
        bodyStates         = body.GetStates();
        bodyStateLabelList = body.GetStateLabels();
        bodyStateIndexDict = body.GetStateIndices();
        gameobject         = body.GetGameObject();

        driveStates         = drives.GetStates();
        driveStateLabelList = drives.GetStateLabels();
        driveStateIndexDict = drives.GetStateIndices();

        actionStates         = motor.GetStates();
        actionStateLabelList = motor.GetStateLabels();
        actionStateIndexDict = motor.GetStateIndices();

        traits         = phenotype.GetTraits();
        traitLabelList = phenotype.GetTraitLabels();
        traitIndexDict = phenotype.GetTraitIndices();

        visualInput = senses.GetVisualInput();
    }
Пример #5
0
 public override void Awake()
 {
     LastAwakeTick = Environment.TickCount; MotorSystem.Start();
 }
Пример #6
0
 public override void Sleep()
 {
     MotorSystem.Stop(); Target = null; mEntity.TargetUID = -1; mEntity.IsInBattle = false;
 }
Пример #7
0
 public SimpleAI(Animal animal, Body body, DriveSystem drives, MotorSystem motor, SensorySystem senses, Phenotype traits) :
     base(body, drives, motor, senses, traits)
 {
     thisAnimal = animal;
     //InitGoalDict();
 }
 public static void SetMotorSystem(MotorSystem motor)
 {
     motorSystem = motor;
 }