コード例 #1
0
        internal static IExperimentRunner CreateExperimentRunner(IExperiment currentExperiment,
                                                                 TraceLab.Core.Workspaces.Workspace workspace,
                                                                 TraceLab.Core.Components.ComponentsLibrary library)
        {
            // Allow all nodes to send info to logs - if any targets exist.
            foreach (TraceLab.Core.Experiments.ExperimentNode node in currentExperiment.Vertices)
            {
                var componentNode = node as TraceLab.Core.Experiments.ComponentNode;
                if (componentNode != null)
                {
                    foreach (TraceLab.Core.Settings.LogLevelItem item in componentNode.Data.Metadata.LogLevels)
                    {
                        item.IsEnabled = true;
                    }
                }
            }

            RunnableNodeFactory templateGraphNodesFactory = new RunnableNodeFactory(workspace);

            TraceLab.Core.ExperimentExecution.RunnableExperimentBase template = GraphAdapter.Adapt(currentExperiment, templateGraphNodesFactory, library, workspace.TypeDirectories);

            var dispatcher = ExperimentRunnerFactory.CreateExperimentRunner(template);

            return(dispatcher);
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RunnableNode"/> class.
 /// </summary>
 /// <param name="id">The id.</param>
 /// <param name="label">The label.</param>
 /// <param name="nextNodes">The next nodes.</param>
 /// <param name="previousNodes">The previous nodes.</param>
 /// <param name="library">The library.</param>
 /// <param name="waitForAllPredecessor">if set to <c>true</c> the node will wait for all predecessor nodes to be completed.</param>
 protected RunnableNode(String id, String label, RunnableNodeCollection nextNodes, RunnableNodeCollection previousNodes, TraceLab.Core.Components.ComponentsLibrary library, bool waitForAllPredecessors)
 {
     Id                      = id;
     Label                   = label;
     NextNodes               = nextNodes;
     PreviousNodes           = previousNodes;
     Library                 = library;
     WaitsForAllPredecessors = waitForAllPredecessors;
 }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DefiningBenchmarkViewModel"/> class.
        /// </summary>
        /// <param name="baseExperiment">The base experiment represents experiment based on which the benchmark is being defined.</param>
        public DefiningBenchmarkViewModel(Experiment baseExperiment, IEnumerable <string> benchmarksDirectories,
                                          TraceLab.Core.Components.ComponentsLibrary library,
                                          TraceLab.Core.Workspaces.Workspace workspace,
                                          IEnumerable <string> workspaceTypeDirectories, string webserviceAddress)
        {
            //initialize the model data based on base experiment
            m_definingBenchmark = new DefiningBenchmark(baseExperiment, library, workspace, TraceLab.Core.PackageSystem.PackageManager.Instance, workspaceTypeDirectories, webserviceAddress);
            Define = new DelegateCommand(ExecuteDefine, CanExecuteDefine);
            SelectBenchmarkPath     = new DelegateCommand(DoSelectBenchmarkPath);
            m_benchmarksDirectories = benchmarksDirectories;

            //intiate authentication view model
            if (m_definingBenchmark.WebService != null)
            {
                m_authenticationViewModel = new AuthenticationAndUploadViewModel <ContestPublishedResponse>(m_definingBenchmark.WebService,
                                                                                                            m_definingBenchmark.ExecutePublishContest,
                                                                                                            Messages.UploadingContestToWebsite, Messages.ContestPublished);
            }
        }
コード例 #4
0
 protected RunnableNode(String id, String label, TraceLab.Core.Components.ComponentsLibrary library, bool waitForAllPredecessors)
     : this(id, label, new RunnableNodeCollection(), new RunnableNodeCollection(), library, waitForAllPredecessors)
 {
 }