/// Helper function that resets all the data structures associated with /// the agent. Typically used when the agent is being initialized or reset /// at the end of an episode. void ResetData() { var param = m_PolicyFactory.brainParameters; m_ActionMasker = new DiscreteActionMasker(param); // If we haven't initialized vectorActions, initialize to 0. This should only // happen during the creation of the Agent. In subsequent episodes, vectorAction // should stay the previous action before the Done(), so that it is properly recorded. if (m_Action.vectorActions == null) { m_Action.vectorActions = new float[param.numActions]; m_Info.storedVectorActions = new float[param.numActions]; } }
/// <summary> /// Collects the masks for discrete actions. /// When using discrete actions, the agent will not perform the masked action. /// </summary> /// <param name="actionMasker"> /// The action masker for the agent. /// </param> /// <remarks> /// When using Discrete Control, you can prevent the Agent from using a certain /// action by masking it with <see cref="DiscreteActionMasker.SetMask(int, IEnumerable{int})"/> /// </remarks> public virtual void CollectDiscreteActionMasks(DiscreteActionMasker actionMasker) { }