Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
using Fluctio.FluctioSim.Common.Configuration;
using Fluctio.FluctioSim.Core.Components.MachineLearning.Triggers;
using UnityEngine;

namespace Fluctio.FluctioSim.Core.Components.MachineLearning.TriggerActions
{
	[AddComponentMenu(Config.PrefixedName+"/Machine Learning/Trigger Actions/End Episode", Config.ComponentMenuOrder + 70)]
	[DefaultExecutionOrder(50)] // to allow adding rewards before ending episode, using the same trigger
	public class EpisodeEnder : AgentAction
	{
		private void OnValidate()
		{
			if (trigger is EnvironmentResetTrigger)
			{
				trigger = null;
				Debug.LogWarning($"{nameof(trigger)} inside {nameof(EpisodeEnder)} can not be set to {nameof(EnvironmentResetTrigger)}, as this will cause infinite recursion");
			}
		}

		public override void OnExecute() => Agent.UnityAgent.EndEpisode();
	}
}