Ejemplo n.º 1
0
        /// <summary>
        /// Constructs the sub experiment.
        /// </summary>
        /// <param name="compositeComponentMetadata">The composite component metadata.</param>
        /// <param name="loggerNameRoot">The logger name root.</param>
        /// <param name="library">The library.</param>
        /// <param name="componentsAppDomain">The components app domain.</param>
        /// <param name="terminateExperimentExecutionResetEvent">The terminate experiment execution reset event - must be the same as top level experiment termination event.</param>
        /// <param name="nodesFactoryOfSubGraph">The nodes factory of sub graph.</param>
        /// <returns></returns>
        private RunnableExperimentBase ConstructSubExperiment(CompositeComponentBaseMetadata compositeComponentMetadata, LoggerNameRoot loggerNameRoot, 
                                                ComponentsLibrary library, AppDomain componentsAppDomain, 
                                                System.Threading.ManualResetEvent terminateExperimentExecutionResetEvent, IRunnableNodeFactory nodesFactoryOfSubGraph)
        {
            //add to experiment id the owner node id to make it unique
            LoggerNameRoot compositeComponentNodeLoggerNameRoot = loggerNameRoot.CreateLoggerNameRootForCompositeNode(compositeComponentMetadata);

            RunnableExperimentBase subExperiment = GraphAdapter.Adapt(compositeComponentMetadata.ComponentGraph, compositeComponentNodeLoggerNameRoot,
                                                                        nodesFactoryOfSubGraph, library, Workspace.TypeDirectories,
                                                                        componentsAppDomain, terminateExperimentExecutionResetEvent, false);

            if (subExperiment.IsEmpty)
            {
                throw new TraceLab.Core.Exceptions.IncorrectSubTemplateException("Unable to execute subexperiment due to errors.");
            }
            return subExperiment;
        }