当前位置: 首页>>代码示例>>C#>>正文


C# Driver.RunStep方法代码示例

本文整理汇总了C#中Driver.RunStep方法的典型用法代码示例。如果您正苦于以下问题:C# Driver.RunStep方法的具体用法?C# Driver.RunStep怎么用?C# Driver.RunStep使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Driver的用法示例。


在下文中一共展示了Driver.RunStep方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Fly200x

		public void Fly200x()
		{
			XmlConfigurator.Configure();
			var vm = new MeetAndGreetEngine(117, 2003, 2003);
			var driver = new Driver(new MeetAndGreetSolver());
			var dv = new Vector(0, 0);
			int goodTime = 0;
			bool repeated = false;
			while (!driver.IsEnd())
			{
				double[] outPorts = vm.RunTimeStep(new Vector(dv.x, dv.y));
				dv = driver.RunStep(outPorts);
				//log.Info("TIME = " + time++);
				if (vm.Mem[336] > 0)
				{
					goodTime = (int) vm.Mem[336];
					log.Info("GOOD_TIME = " + goodTime);
				}
				else if (goodTime > 0)
				{
					if (repeated) break;
					repeated = true;
				}
				else
				{
					repeated = false;
				}
				//log.Info("DISTANCE_TO_TARGET_ORBIT = " + vm.Mem[155]);
			}
			if (driver.UnderlyingSolver.State.Score > 0)
			{
				File.WriteAllBytes("res2001.bin", vm.CreateSubmission());
				Console.WriteLine(driver.UnderlyingSolver.State.Score);
			}
		}
开发者ID:dharco,项目名称:all-my-circuirs,代码行数:35,代码来源:MeetAndGreetSolver_Test.cs

示例2: Fly1004

		public void Fly1004()
		{
			XmlConfigurator.Configure();
			//var vm = new VirtualMachine(117, 1001, 1001, TestData.Hohmann);
			var vm = new HohmannsEngine(117, 1004);
			var driver = new Driver(new HohmannSolver());
			var dv = new Vector(0, 0);
			while (!driver.IsEnd())
			{
				var outPorts = vm.RunTimeStep(new Vector(dv.x, dv.y));
				dv = driver.RunStep(outPorts);
				//log.Info("TIME = " + time++);
				if(vm.Mem[212] > 0) log.Info("GOOD_TIME = " + vm.Mem[212]);
				//log.Info("DISTANCE_TO_TARGET_ORBIT = " + vm.Mem[155]);
			}
			File.WriteAllBytes("res.bin", vm.CreateSubmission());
		}
开发者ID:dharco,项目名称:all-my-circuirs,代码行数:17,代码来源:HohmannSolver_Test.cs


注:本文中的Driver.RunStep方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。