/// <summary> /// Write AgentInfo experience to file. /// </summary> internal void Record(AgentInfo info, List <ISensor> sensors) { if (m_Writer == null) { // Already closed return; } // Increment meta-data counters. m_MetaData.numberExperiences++; m_CumulativeReward += info.reward; if (info.done) { EndEpisode(); } // Generate observations and add AgentInfo to file. var agentProto = info.ToInfoActionPairProto(); foreach (var sensor in sensors) { agentProto.AgentInfo.Observations.Add(sensor.GetObservationProto(m_WriteAdapter)); } agentProto.WriteDelimitedTo(m_Writer); }
/// <summary> /// Write AgentInfo experience to file. /// </summary> public void Record(AgentInfo info, List <Observation> observations) { // Increment meta-data counters. m_MetaData.numberExperiences++; m_CumulativeReward += info.reward; if (info.done) { EndEpisode(); } // Write AgentInfo to file. var agentProto = info.ToInfoActionPairProto(observations); agentProto.WriteDelimitedTo(m_Writer); }