コード例 #1
0
ファイル: Controller.cs プロジェクト: dharco/all-my-circuirs
		public Controller(ProblemDescription problem)
		{
			if (problem.Solver is HohmannSolver)
				vm = new HohmannsEngine(117, problem.ScenarioNumber);
			else if(problem.Solver is MeetAndGreetSolver)
				vm = new MeetAndGreetEngine(117, problem.ScenarioNumber, problem.ScenarioNumber);
			else if(problem.Solver is EccentricMeetAndGreetSolver)
				vm = new EccentricMeetAndGreetEngine(117, problem.ScenarioNumber);
			else 
				throw new ArgumentException("неизвестный солвер!");

			solverDriver = new Driver(problem.Solver);
			simulationThread = new Thread(Simulate) { Name = "Симулятор", IsBackground  = true }; 
      simulationThread.Start();
		}
コード例 #2
0
		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());
		}