public PieSlices(Agent me, AdjacentAgents adjAgents, int numSlices = 4, int pieAngle = 360) : base(me) { this.adjAgents = adjAgents; this.numSlices = numSlices; this.pieAngle = pieAngle; sliceAngle = pieAngle/(float)numSlices; agentsWithinSlices = new List<Agent>[numSlices]; }
//Initialize the agent protected override void initializeAgent() { base.initializeAgent(); adjAgents = new AdjacentAgents (this, radius * 11, grid, typeof(HumanAgent));//TODO play around with radius value; smaller than humans aStar = new AStar (this); drawSource = false; drawTarget = false; drawPath = false; drawNodes = false; selectable = true; selected = false; IPfsm = new IciclePenguinFSM (this); }
// Use this for initialization protected override void initializeAgent() { numInputs = 4; numOutputs = 2; numLayers = 1; numNeuronsPerLayer = 6; targetsEnabled = true; mouseIsTarget = false; userControl = false; //Create sensors feelers = new Feelers(this, radius*3); //TODO add perpendicular feelers to allow agent to know when it's moving along a wall. adjAgents = new AdjacentAgents(this, radius*3, grid); pieSlices = new PieSlices(this, adjAgents); //Create brain and genetic algorithm brain = new NeuralNet(numInputs, numOutputs, numLayers, numNeuronsPerLayer); setGeneticAlgorithm( new GeneticAlgorithmOld(40, numInputs, numOutputs, numLayers, numNeuronsPerLayer)); startLocation = transform.position; startRotation = transform.rotation; createFourTargets(); reset (); }
// Use this for initialization protected override void initializeAgent() { seekMouse = false; //Sensors feelers = new Feelers(this, radius*3); adjAgents = new AdjacentAgents(this, radius*3, grid); pieSlices = new PieSlices(this, adjAgents); }
// Use this for initialization protected override void initializeAgent() { base.initializeAgent(); startPosition = transform.position; holdingICEMachine = false; hit = false; brain.initialize(this); adjAgents = new AdjacentAgents(this, radius * 8, grid, typeof(IciclePenguins)); adjAgents.toggleDisplay(); GetComponent<SpriteRenderer>().sprite = humanSprites[UnityEngine.Random.Range(0, humanSprites.Length)]; humanFSM = new HumanFSM(this); deathFade = 2; }