Exemplo n.º 1
0
 public void MergeFrom(AgentInfoProto other)
 {
     if (other == null)
     {
         return;
     }
     stackedVectorObservation_.Add(other.stackedVectorObservation_);
     visualObservations_.Add(other.visualObservations_);
     if (other.TextObservation.Length != 0)
     {
         TextObservation = other.TextObservation;
     }
     storedVectorActions_.Add(other.storedVectorActions_);
     if (other.StoredTextActions.Length != 0)
     {
         StoredTextActions = other.StoredTextActions;
     }
     memories_.Add(other.memories_);
     if (other.Reward != 0F)
     {
         Reward = other.Reward;
     }
     if (other.Done != false)
     {
         Done = other.Done;
     }
     if (other.MaxStepReached != false)
     {
         MaxStepReached = other.MaxStepReached;
     }
     if (other.Id != 0)
     {
         Id = other.Id;
     }
     actionMask_.Add(other.actionMask_);
     if (other.customObservation_ != null)
     {
         if (customObservation_ == null)
         {
             CustomObservation = new global::MLAgents.CommunicatorObjects.CustomObservation();
         }
         CustomObservation.MergeFrom(other.CustomObservation);
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Exemplo n.º 2
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 10:
                case 13: {
                    stackedVectorObservation_.AddEntriesFrom(input, _repeated_stackedVectorObservation_codec);
                    break;
                }

                case 18: {
                    visualObservations_.AddEntriesFrom(input, _repeated_visualObservations_codec);
                    break;
                }

                case 26: {
                    TextObservation = input.ReadString();
                    break;
                }

                case 34:
                case 37: {
                    storedVectorActions_.AddEntriesFrom(input, _repeated_storedVectorActions_codec);
                    break;
                }

                case 42: {
                    StoredTextActions = input.ReadString();
                    break;
                }

                case 50:
                case 53: {
                    memories_.AddEntriesFrom(input, _repeated_memories_codec);
                    break;
                }

                case 61: {
                    Reward = input.ReadFloat();
                    break;
                }

                case 64: {
                    Done = input.ReadBool();
                    break;
                }

                case 72: {
                    MaxStepReached = input.ReadBool();
                    break;
                }

                case 80: {
                    Id = input.ReadInt32();
                    break;
                }

                case 90:
                case 88: {
                    actionMask_.AddEntriesFrom(input, _repeated_actionMask_codec);
                    break;
                }

                case 98: {
                    if (customObservation_ == null)
                    {
                        CustomObservation = new global::MLAgents.CommunicatorObjects.CustomObservation();
                    }
                    input.ReadMessage(CustomObservation);
                    break;
                }
                }
            }
        }