Example #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="collection">Collection</param>
 /// <param name="priority">Priority</param>
 /// <param name="reason">Reason</param>
 public TimeProviderBackup(IComponentCollection collection, int priority, string reason)
 {
     this.collection = collection;
     CreateMeasurements(priority, reason);
     runtime = StaticExtensionDataPerformerPortable.Factory.Create(collection, priority);
     SetTimeProvider(collection, StaticExtensionDataPerformerPortable.Factory.TimeProvider, dictionary);
     processor = DifferentialEquationProcessors.DifferentialEquationProcessor.Processor;
     processor.Set(collection);
 }
Example #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="collection">Collection</param>
 /// <param name="provider">Time provider</param>
 /// <param name="processor">Differential equation processor</param>
 /// <param name="priority">Priority</param>
 /// <param name="reason">Reason</param>
 public TimeProviderBackup(IComponentCollection collection, ITimeMeasureProvider provider,
                           IDifferentialEquationProcessor processor, int priority, string reason)
 {
     this.collection = collection;
     SetCollectionHolders();
     CreateMeasurements(priority, reason);
     runtime = StaticExtensionDataPerformerPortable.Factory.Create(collection, priority);
     SetTimeProvider(collection.AllComponents, provider, dictionary);
     this.processor = processor;
     processor.Set(collection);
 }
Example #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="consumer">Data consumer</param>
 /// <param name="provider">Time provider</param>
 /// <param name="processor">Differential equation processor</param>
 /// <param name="reason">Reason</param>
 /// <param name="priority">Priority</param>
 public TimeProviderBackup(IDataConsumer consumer, ITimeMeasureProvider provider, IDifferentialEquationProcessor processor, string reason, int priority)
 {
     this.consumer = consumer;
     collection    = consumer.GetDependentCollection(priority);
     SetTimeProvider(collection, provider, dictionary);
     CreateMeasurements(priority, null);
     runtime        = consumer.CreateRuntime(reason, priority);
     this.processor = processor;
     if (processor != null)
     {
         processor.Set(collection); // !!! added to allow buffer processing, as no IDifferentialEquationProcessoris required there
     }
 }
Example #4
0
        /// <summary>
        /// Creates processor
        /// </summary>
        /// <param name="collection"></param>
        /// <returns></returns>
        protected virtual IDifferentialEquationProcessor CreateProcessor(IComponentCollection collection)
        {
            IDifferentialEquationProcessor pr = null;

            collection.ForEach((IDifferentialEquationSolver s) =>
            {
                if (pr == null)
                {
                    pr = DifferentialEquationProcessor.Processor.New;
                    pr.Set(collection);
                }
            });
            if (realtime != null & pr != null)
            {
                pr.TimeProvider = realtime;
            }
            return(pr);
        }
Example #5
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="consumer">Data consumer</param>
        /// <param name="provider">Time provider</param>
        /// <param name="processor">Differential equation processor</param>
        /// <param name="reason">Reason</param>
        /// <param name="priority">Priority</param>
        public TimeProviderBackup(IDataConsumer consumer, ITimeMeasureProvider provider,
                                  IDifferentialEquationProcessor processor, string reason, int priority)
        {
            this.consumer = consumer;
            collection    = consumer.GetDependentCollection(priority);
            SetCollectionHolders();
            List <object> l = new List <object>(collection.AllComponents);

            if (!l.Contains(consumer))
            {
                l.Add(consumer);
            }
            SetTimeProvider(l, provider, dictionary);
            CreateMeasurements(priority, null);
            runtime = consumer.CreateRuntime(reason, priority);
            if (processor != null)
            {
                this.processor = processor;
                processor.Set(collection);
            }
        }
Example #6
0
 /// <summary>
 /// Sets collection
 /// </summary>
 /// <param name="processor">The processor</param>
 /// <param name="collection">The colletion</param>
 /// <returns>List of variables</returns>
 static public void Set(this IDifferentialEquationProcessor processor, IComponentCollection collection)
 {
     processor.Set(collection);
 }