Example #1
0
        public void TestDefaultBrainParametersToProto()
        {
            // Should be able to convert a default instance to proto.
            var brain = new BrainParameters();

            brain.ToProto("foo", false);
            Academy.Instance.TrainerCapabilities = new UnityRLCapabilities
            {
                BaseRLCapabilities = true,
                HybridActions      = false
            };
            brain.ToProto("foo", false);
        }
Example #2
0
        public void TestDefaultBrainParametersToProto()
        {
            // Should be able to convert a default instance to proto.
            var brain = new BrainParameters();

            brain.ToProto("foo", false);
        }
        /// <summary>
        /// Writes brain parameters to file.
        /// </summary>
        /// <param name="brainName">The name of the Brain the agent is attached to.</param>
        /// <param name="brainParameters">The parameters of the Brain the agent is attached to.</param>
        void WriteBrainParameters(string brainName, BrainParameters brainParameters)
        {
            if (m_Writer == null)
            {
                // Already closed
                return;
            }

            // Writes BrainParameters to file.
            m_Writer.Seek(MetaDataBytes + 1, 0);
            var brainProto = brainParameters.ToProto(brainName, false);

            brainProto.WriteDelimitedTo(m_Writer);
        }