Esempio n. 1
0
        /// <summary>
        /// This method contains logic to be performed prior to a replication.
        /// It is called once before every replication. This method ensures that each contained model element has its StrictlyDoBeforeReplication method called.
        /// It also calls the DoBeforeReplication method which contains optional logic.
        /// </summary>
        internal void StrictlyOnReplicationStart()
        {
            ObserverState = ModelElementObserverState.REPLICATION_START;
            NotifyObservers(this);

            if (LengthOfWarmUp > 0)
            {
                GetExecutive.ScheduleEvent(GetExecutive.Time + LengthOfWarmUp, HandleEndWarmUp);
                ObserverState = ModelElementObserverState.WARMUP;
                NotifyObservers(this);
            }
            else
            {
                ObserverState = ModelElementObserverState.INITIALIZED;
                NotifyObservers(this);
                ObserverState = ModelElementObserverState.UPDATE;
            }

            OnReplicationStart();

            if (modelElements.Any())
            {
                foreach (ModelElementBase modelElement in modelElements)
                {
                    modelElement.StrictlyOnReplicationStart();
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// This method contains logic to be performed after a replication.
        /// It is called once after every replication. This method ensures that each contained model element has its StrictlyDoAfterReplication method called.
        /// It also calls the DoAfterReplication method which contains optional logic.
        /// </summary>
        internal void StrictlyOnReplicatioEnd()
        {
            ObserverState = ModelElementObserverState.REPLICATION_END;
            NotifyObservers(this);

            OnReplicationEnd();

            if (modelElements.Any())
            {
                foreach (ModelElementBase modelElement in modelElements)
                {
                    modelElement.StrictlyOnReplicatioEnd();
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// This method contains logic to be performed after an experiment.
        /// It is called once after the first replication. This method ensures that each contained model element has its StrictlyOnExperimentEnd method called.
        /// It also calls the OnExperimentEnd method which contains optional logic.
        /// </summary>
        internal void StrictlyOnExperimentEnd()
        {
            ObserverState = ModelElementObserverState.EXPERIMENT_END;
            NotifyObservers(this);

            OnExperimentEnd();

            if (modelElements.Any())
            {
                foreach (ModelElementBase modelElement in modelElements)
                {
                    modelElement.StrictlyOnExperimentEnd();
                }
            }
        }
Esempio n. 4
0
        /// <summary>
        /// This method contains logic to be performed after a replication.
        /// It is called once after every replication. This method ensures that each contained model element has its StrictlyDoAfterReplication method called.
        /// It also calls the DoAfterReplication method which contains optional logic.
        /// </summary>
        internal void StrictlyDoAfterReplication()
        {
            ObserverState = ModelElementObserverState.AFTER_REPLICATION;
            NotifyObservers(this);

            DoAfterReplication();

            if (modelElements.Any())
            {
                foreach (ModelElementBase modelElement in modelElements)
                {
                    modelElement.StrictlyDoAfterReplication();
                }
            }
        }
Esempio n. 5
0
        /// <summary>
        /// This method contains logic to be performed after an experiment.
        /// It is called once after the first replication. This method ensures that each contained model element has its StrictlyDoAfterExperiment method called.
        /// It also calls the DoBeforeExperiment method which contains optional logic.
        /// </summary>
        internal void StrictlyDoAfterExperiment()
        {
            ObserverState = ModelElementObserverState.AFTER_EXPERIMENT;
            NotifyObservers(this);

            DoAfterExperiment();

            if (modelElements.Any())
            {
                foreach (ModelElementBase modelElement in modelElements)
                {
                    modelElement.StrictlyDoBeforeExperiment();
                }
            }
        }
Esempio n. 6
0
 private void HandleEndWarmUp(CSSLEvent e)
 {
     ObserverState = ModelElementObserverState.INITIALIZED;
     NotifyObservers(this);
     ObserverState = ModelElementObserverState.UPDATE;
 }