コード例 #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// \fn private void TakeSnapshot()
        ///
        /// \brief Take snapshot.
        ///
        /// \par Description.
        ///
        /// \par Algorithm.
        ///      -# Advance round
        ///      -# Take the status of the processor (in this simulation take the round)
        ///      -# Set the recorded parameter to true
        ///      -# Clear the list of source processes that sent report
        ///      -3 Send Marker message to all the neighbors with weight
        ///
        /// \par Usage Notes.
        ///
        /// \author Ilanh
        /// \date 21/01/2018
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        private void TakeSnapshot()
        {
            if (!Recorderd)
            {
                Round++;
                Snapshot  = StatusColor;
                Recorderd = true;
                ReceivedMessageFrom.Clear();
                double weight          = Weight;
                int    numOfNeighbours = OutChannels.Count;
                Weight = weight / 2;
                SendMarker(MessageDataFor_Marker(bm.PrmSource.Prms, null,
                                                 weight / (2 * numOfNeighbours)));
                if (Initiator)
                {
                    Results.Add("--- Results of round " + Round + " --");
                }
            }
        }