protected override void ProcessRecord() { var startJob = new StartJobParameters { StartInfo = new StartProcessDto { ReleaseKey = Process.Key, Source = StartProcessDtoSource.Manual, } }; if (All.IsPresent) { startJob.StartInfo.Strategy = StartProcessDtoStrategy.All; } else if (RobotCount.HasValue) { startJob.StartInfo.Strategy = StartProcessDtoStrategy.RobotCount; startJob.StartInfo.NoOfRobots = RobotCount.Value; } else if (Robots != null) { startJob.StartInfo.Strategy = StartProcessDtoStrategy.Specific; startJob.StartInfo.RobotIds = Robots.Cast <long?>().ToList(); } var jobs = HandleHttpOperationException(() => Api.Jobs.StartJobs(startJob)); foreach (var dto in jobs.Value) { WriteObject(Models.Job.FromDto(dto)); } }
public override void RunSearch() { var whcaStarRobots = Robots.Cast <WHCAStarRobot>(); var enRoute = whcaStarRobots.Where(r => r.Position != null && r.Position != r.Target).ToList(); while (enRoute.Count > 0) { foreach (var robot in whcaStarRobots) { robot.Step(ref _reservationTable); } enRoute = whcaStarRobots.Where(r => r.Position != null && r.Position != r.Target).ToList(); } }
public override void RunSearch() { var lraStarRobots = Robots.Cast <LRAStarRobot>(); foreach (var robot in lraStarRobots) { var graph = Graph.Clone(); foreach (var neighbor in graph.AdjacentVertices(robot.Start)) { if (lraStarRobots.Any(r => r.Start == neighbor)) { graph.RemoveAdjacentEdges(neighbor); } } robot.Search(graph); } var enRoute = lraStarRobots.Where(r => r.Position != null && r.Position != r.Target); while (enRoute.Any()) { foreach (var robot in enRoute) { var next = robot.Step(); // get the next position if (next != null && lraStarRobots.Any(r => r.Position == next)) { // occupied - recalculate remainder of the route var graph = Graph.Clone(); graph.RemoveAdjacentEdges(next); robot.Search(graph); } else { robot.Position = next; // move to the next position } } enRoute = lraStarRobots.Where(r => r.Position != null && r.Position != r.Target); } }
public override void RunSearch() { var dStarRobots = Robots.Cast <DStarRobot>(); foreach (var robot in dStarRobots) { robot.Initialize(Graph); } var enRoute = dStarRobots.Where(r => r.Position != null && r.Position != r.Target).ToList(); while (enRoute.Count > 0) { foreach (var robot in enRoute) { var occupied = Graph.AdjacentVertices(robot.Position).Where(v => dStarRobots.Any(r => r.Position == v)); robot.Step(occupied); } enRoute = dStarRobots.Where(r => r.Position != null && r.Position != r.Target).ToList(); } }