本文整理汇总了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);
}
}
示例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());
}