public LogisticMap(double mu, double r0, double rmax, double dr)
        {
            mapData.ChartType = SeriesChartType.Point ;
            mapData.MarkerSize = 1;
            mapData.MarkerColor = Color.Black;

            int numberOfThreadsInMap =1 ;
            List<double> activeThreadValues;
            double eps = .005;
            for(double r = r0; r < rmax; r+= dr ){
                activeThreadValues = new List<double>();
                Func<double, double> log = i => r * i * (1 - Math.Pow(i, mu));
                for (int i = 150; i < 260; i++) {
                    var A = new Sequence(log,	.2).GetElementAt(i);
                    if (A > double.MaxValue || A < double.MinValue) {
                        break;
                    }
                    if (activeThreadValues.Where(j => j < A + eps && j > A - eps).Count() == 0)
                        activeThreadValues.Add(A);
                    mapData.Points.AddXY(r, A);
                }
                if (activeThreadValues.Count > numberOfThreadsInMap) {
                    Console.WriteLine("Bifurcation point: " + r.ToString() + " " + activeThreadValues.Count.ToString() + " threads.");
                    numberOfThreadsInMap = activeThreadValues.Count();
                    eps /= numberOfThreadsInMap;
                }
            }
        }
        public void InstructionToNodeConversionWithLeadingAndTrailing()
        {
            var input = new List<Instruction>
            {
                X.StartMember<Setter>(c => c.Value),
                X.EndMember(),
            };

            var sut = new InstructionTreeBuilder();
            var actual = sut.CreateHierarchy(input).ToList();
            var expected = new Sequence<InstructionNode>
            {
                new InstructionNode
                {
                    Leading = X.StartMember<Setter>(c => c.Value),
                    Trailing = X.EndMember(),
                }
            };

            Assert.Equal(expected, actual);
        }
Example #3
0
        public void Play()
        {
            // Build a track object from
            // the current session
            m_Session.Build();
            Track trk = m_Session.Result;

            // Create a new sequence
            // from the current track
            Sequence seq = new Sequence();
            seq.Add(trk);

            // Load the sequence into
            // the sequencer
            Sequencer.Sequence = seq;

            // Start playing
            Sequencer.Start();

            CanPlay = false;
            CanPause = true;
        }