Пример #1
0
        public void Schedule(MyProject project, IEnumerable <MyWorkingNode> newNodes = null)
        {
            // If there are any init tasks in the current plan, copy them over to the new one.
            // This is mostly for the first simulation step if there is also a model change.
            MyExecutionBlock oldPlan = null;

            if (ExecutionPlan != null)
            {
                oldPlan = ExecutionPlan.InitStepPlan;
            }

            m_project     = project;
            ExecutionPlan = ExecutionPlanner.CreateExecutionPlan(project, newNodes);

            if (oldPlan != null)
            {
                var newInitPlan = new List <IMyExecutable>();
                newInitPlan.AddRange(oldPlan.Children);
                newInitPlan.AddRange(ExecutionPlan.InitStepPlan.Children);
                ExecutionPlan.InitStepPlan = new MyExecutionBlock(newInitPlan.ToArray())
                {
                    Name = oldPlan.Name
                };
            }

            ExtractAllNodes(m_project);

            // Allow subclasses to react to re-scheduling.
            ScheduleChanged();
        }
Пример #2
0
        public void Schedule(MyProject project)
        {
            MyExecutionPlan singleCoreExecutionPlan = ExecutionPlanner.CreateExecutionPlan(project);

            ExecutionPlan = PartitioningStrategy.Divide(singleCoreExecutionPlan);

            //TODO: remove this and replace with proper project traversal to find nodes with no tasks!
            ExtractPartitioningFromExecutionPlan();
        }