Exemple #1
0
 public override void InitializeAgent()
 {
     _area          = GetComponentInParent <TrainingArea>();
     _rigidBody     = GetComponent <Rigidbody>();
     _rewardPerStep = agentParameters.maxStep > 0 ? -1f / agentParameters.maxStep : 0;
     _playerScript  = GameObject.FindObjectOfType <PlayerControls>();
 }
Exemple #2
0
    private float farthestDistanceFromSpawn;//the record distance the bot has traveled from its spawn position. used to reward bots when the venture from the spawn position to find the other bots

    // Start is called before the first frame update
    void Start()
    {
        spawnRotation = transform.localRotation;
        Health        = maxHealth;
        CurrentItem   = currentItem;
        currentWeapon.WeaponHolder = this;
        trainingArea = GetComponentInParent <TrainingArea>();
    }
        private void trainingAreas_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (TrainingArea != null)
            {
                toolTip.SetToolTip(trainingAreas, TrainingArea.GetDetails(0));
            }

            RefreshIncidentTypes();
        }
Exemple #4
0
    //Override the Initialize function in the Agent class
    public override void Initialize()
    {
        //Call the base class function
        base.Initialize();

        //Get components and goal object for later use
        trainingArea = GetComponentInParent <TrainingArea>();
        goal         = trainingArea.goal;
        rb           = GetComponent <Rigidbody>();
    }
Exemple #5
0
    public override void InitializeAgent()
    {
        _area          = GetComponentInParent <TrainingArea>();
        _rigidBody     = GetComponent <Rigidbody>();
        _rewardPerStep = agentParameters.maxStep > 0 ? -1f / agentParameters.maxStep : 0;
        _playerScript  = GameObject.FindObjectOfType <PlayerControls>();

        Debug.Log("InitializeAgent called");
        _area         = GetComponentInParent <TrainingArea>();
        _rigidBody    = GetComponent <Rigidbody>();
        _playerScript = GameObject.FindObjectOfType <PlayerControls>();
        // Negative reward to motivate the agent
        _rewardPerStep = agentParameters.maxStep > 0 ? -1f / agentParameters.maxStep : 0; // can remove it
        //_trainingArea.GetComponent<ArenaBuilders>()._goodgoal
        hotZone = GameObject.Find("HotZone(Clone)");
    }
        public virtual string GetDetails(int indentLevel)
        {
            string indent = "";

            for (int i = 0; i < indentLevel; ++i)
            {
                indent += "\t";
            }

            return((indentLevel > 0 ? Environment.NewLine : "") + indent + "Type:  " + GetType() + Environment.NewLine +
                   indent + "ID:  " + _id + Environment.NewLine +
                   indent + "Name:  " + _name + Environment.NewLine +
                   indent + "Incident types:  " + _incidentTypes.Concatenate(",") + Environment.NewLine +
                   indent + "Training area:  " + TrainingArea.GetDetails(indentLevel + 1) + Environment.NewLine +
                   indent + "Training start:  " + _trainingStart.ToShortDateString() + " " + _trainingStart.ToShortTimeString() + Environment.NewLine +
                   indent + "Training end:  " + _trainingEnd.ToShortDateString() + " " + _trainingEnd.ToShortTimeString() + Environment.NewLine +
                   indent + "Smoothers:  " + _smoothers.Select(s => s.GetSmoothingDetails()).Concatenate(", ") + Environment.NewLine +
                   (ModelDirectory == "" ? "" : indent + "Model directory:  " + ModelDirectory));
        }