示例#1
0
 void OnClickReloadNet()
 {
     if (network == null)
     {
         return;
     }
     Selection.activeObject = null;
     network.LoadNetwork(true, true);
 }
示例#2
0
    /// !_USER METHODS /// ------------------------------------------------------------------------------------------------

    public ANNNetwork CreateChild(ANNAgent agent)
    {
        ANNNetwork child = this.Instanciate();

        child.LoadNetwork(false, true);
        child.agent = agent;
        children.Add(child);
        return(child);
    }
示例#3
0
    // Use this for initialization
    void Start()
    {
        if (Application.isPlaying)
        {
            base_agent = AgentPrefab.GetComponent <ANNAgent>();
            if (base_agent == null)
            {
                Debug.LogError("ANNAcademy => Trying to use an AgentPrefab without an ANNAgent Component.");
                return;
            }
            base_net         = base_agent.network;
            base_net.topBest = 0;

            switch (base_net.TrainingType)
            {
            case ANNNetwork.ANNNetworkTrainingType.MultiAgent:              // MULTI
                ReplicateAgent(AgentPrefab);
                break;

            case ANNNetwork.ANNNetworkTrainingType.SingleAgent:             // SINGLE
                AgentPrefab.SetActive(true);
                StartAgent(base_agent);
                break;
            }
        }
        else if (Application.isEditor)
        {
            if (AgentPrefab != null)
            {
                base_agent = AgentPrefab.GetComponent <ANNAgent>();
                if (base_agent != null)
                {
                    base_net = base_agent.network;
                    base_net.LoadNetwork(true, true);
                }
            }
        }
    }